You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Lisa Ziri <li...@gmail.com> on 2015/04/19 12:35:24 UTC

Changing analyzer in an indexwriter

Hi,
I'm upgrading to lucene 5.1.0 from lucene 4.
In our index we have documents in different languages which are analyzed
with the correct analyzer.
We used the method addDocument of IndexWriter giving the correct analyzer
for every different document.
Now I see that I can define the analyzer used by the IndexWriter only in
the creation and I cannot switch analyzer on the same IndexWriter.
We allow to do some searches cross languages, so we cannot separate the
documents in diferrent indexes.
Suggestions for the better way to solve this use case?
Thank you,

Lisa

Re: Changing analyzer in an indexwriter

Posted by Michael McCandless <lu...@mikemccandless.com>.
Thanks, I'll fix MIGRATE.txt to mention this.

Mike McCandless

http://blog.mikemccandless.com


On Mon, Apr 20, 2015 at 9:08 AM, Anna Elisabetta Ziri
<an...@nemoris.it> wrote:
> Thank you everyone! Could I suggest that this change should be mentioned in
> the migration guide? In our case it requires a complete reindex and code
> change (in search too) so maybe others are in the same situation.
> Thank you again for the prompt help,
>
> Lisa
>
>
> Il giorno lun 20 apr 2015 alle ore 10:43 Michael McCandless <
> lucene@mikemccandless.com> ha scritto:
>
>> See the discussion on
>> https://issues.apache.org/jira/browse/LUCENE-6212 about this?  It's
>> best to isolate different languages into different fields...
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>>
>> On Sun, Apr 19, 2015 at 8:37 AM, Ahmet Arslan <io...@yahoo.com.invalid>
>> wrote:
>> > Hi Lisa,
>> >
>> > I think AnalyzerWrapper
>> >
>> https://lucene.apache.org/core/4_0_0/core/org/apache/lucene/analysis/AnalyzerWrapper.html
>> >
>> > Ahmet
>> >
>> >
>> > On Sunday, April 19, 2015 1:37 PM, Lisa Ziri <li...@gmail.com> wrote:
>> > Hi,
>> > I'm upgrading to lucene 5.1.0 from lucene 4.
>> > In our index we have documents in different languages which are analyzed
>> > with the correct analyzer.
>> > We used the method addDocument of IndexWriter giving the correct analyzer
>> > for every different document.
>> > Now I see that I can define the analyzer used by the IndexWriter only in
>> > the creation and I cannot switch analyzer on the same IndexWriter.
>> > We allow to do some searches cross languages, so we cannot separate the
>> > documents in diferrent indexes.
>> > Suggestions for the better way to solve this use case?
>> > Thank you,
>> >
>> > Lisa
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> > For additional commands, e-mail: java-user-help@lucene.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Changing analyzer in an indexwriter

Posted by Anna Elisabetta Ziri <an...@nemoris.it>.
Thank you everyone! Could I suggest that this change should be mentioned in
the migration guide? In our case it requires a complete reindex and code
change (in search too) so maybe others are in the same situation.
Thank you again for the prompt help,

Lisa


Il giorno lun 20 apr 2015 alle ore 10:43 Michael McCandless <
lucene@mikemccandless.com> ha scritto:

> See the discussion on
> https://issues.apache.org/jira/browse/LUCENE-6212 about this?  It's
> best to isolate different languages into different fields...
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
>
> On Sun, Apr 19, 2015 at 8:37 AM, Ahmet Arslan <io...@yahoo.com.invalid>
> wrote:
> > Hi Lisa,
> >
> > I think AnalyzerWrapper
> >
> https://lucene.apache.org/core/4_0_0/core/org/apache/lucene/analysis/AnalyzerWrapper.html
> >
> > Ahmet
> >
> >
> > On Sunday, April 19, 2015 1:37 PM, Lisa Ziri <li...@gmail.com> wrote:
> > Hi,
> > I'm upgrading to lucene 5.1.0 from lucene 4.
> > In our index we have documents in different languages which are analyzed
> > with the correct analyzer.
> > We used the method addDocument of IndexWriter giving the correct analyzer
> > for every different document.
> > Now I see that I can define the analyzer used by the IndexWriter only in
> > the creation and I cannot switch analyzer on the same IndexWriter.
> > We allow to do some searches cross languages, so we cannot separate the
> > documents in diferrent indexes.
> > Suggestions for the better way to solve this use case?
> > Thank you,
> >
> > Lisa
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Changing analyzer in an indexwriter

Posted by Michael McCandless <lu...@mikemccandless.com>.
See the discussion on
https://issues.apache.org/jira/browse/LUCENE-6212 about this?  It's
best to isolate different languages into different fields...

Mike McCandless

http://blog.mikemccandless.com


On Sun, Apr 19, 2015 at 8:37 AM, Ahmet Arslan <io...@yahoo.com.invalid> wrote:
> Hi Lisa,
>
> I think AnalyzerWrapper
> https://lucene.apache.org/core/4_0_0/core/org/apache/lucene/analysis/AnalyzerWrapper.html
>
> Ahmet
>
>
> On Sunday, April 19, 2015 1:37 PM, Lisa Ziri <li...@gmail.com> wrote:
> Hi,
> I'm upgrading to lucene 5.1.0 from lucene 4.
> In our index we have documents in different languages which are analyzed
> with the correct analyzer.
> We used the method addDocument of IndexWriter giving the correct analyzer
> for every different document.
> Now I see that I can define the analyzer used by the IndexWriter only in
> the creation and I cannot switch analyzer on the same IndexWriter.
> We allow to do some searches cross languages, so we cannot separate the
> documents in diferrent indexes.
> Suggestions for the better way to solve this use case?
> Thank you,
>
> Lisa
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Changing analyzer in an indexwriter

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi Lisa,

I think AnalyzerWrapper
https://lucene.apache.org/core/4_0_0/core/org/apache/lucene/analysis/AnalyzerWrapper.html

Ahmet


On Sunday, April 19, 2015 1:37 PM, Lisa Ziri <li...@gmail.com> wrote:
Hi,
I'm upgrading to lucene 5.1.0 from lucene 4.
In our index we have documents in different languages which are analyzed
with the correct analyzer.
We used the method addDocument of IndexWriter giving the correct analyzer
for every different document.
Now I see that I can define the analyzer used by the IndexWriter only in
the creation and I cannot switch analyzer on the same IndexWriter.
We allow to do some searches cross languages, so we cannot separate the
documents in diferrent indexes.
Suggestions for the better way to solve this use case?
Thank you,

Lisa

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org