Mailing List Archive

Compatibility problems between AnalyzerWrapper api & MultiTerms.getTerms api
I'm using AnalyzerWrapper to do per-field analyzer to do special indexing:

PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(..);
// PerFieldAnalyzerWrapper is subclass of Lucene's AnalyzerWrapper
IndexWriterConfig iwc = new IndexWriterConfig(analyzer);

However, i found that later when i used MultiTerms.getTerms to load the
specific field's term dictionary, it's like it is still analyzed by
Lucene's StandardAnalyzer.

I have to use another trick to bypass this problem(use
custom IndexableField class to do per-field custom analyzer, which is not
needed to detail here), i guess ultiTerms.getTerms is an experimental api
so it's not consistent with nalyzerWrapper?
Re: Compatibility problems between AnalyzerWrapper api & MultiTerms.getTerms api [ In reply to ]
Could you create a test case that is as small as possible and reproduces
the problem? I don't think that MultiTerms has anything to do with this.

On Tue, Apr 14, 2020 at 9:52 AM ??? <ctengctsh@gmail.com> wrote:

> I'm using AnalyzerWrapper to do per-field analyzer to do special indexing:
>
> PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(..);
> // PerFieldAnalyzerWrapper is subclass of Lucene's AnalyzerWrapper
> IndexWriterConfig iwc = new IndexWriterConfig(analyzer);
>
> However, i found that later when i used MultiTerms.getTerms to load the
> specific field's term dictionary, it's like it is still analyzed by
> Lucene's StandardAnalyzer.
>
> I have to use another trick to bypass this problem(use
> custom IndexableField class to do per-field custom analyzer, which is not
> needed to detail here), i guess ultiTerms.getTerms is an experimental api
> so it's not consistent with nalyzerWrapper?
>


--
Adrien
Re: Compatibility problems between AnalyzerWrapper api & MultiTerms.getTerms api [ In reply to ]
you're right! i made a mistake in my custom AnalyzerWrapper subclass... :-<

Adrien Grand <jpountz@gmail.com> ?2020?4?15??? ??5:37???

> Could you create a test case that is as small as possible and reproduces
> the problem? I don't think that MultiTerms has anything to do with this.
>
> On Tue, Apr 14, 2020 at 9:52 AM ??? <ctengctsh@gmail.com> wrote:
>
> > I'm using AnalyzerWrapper to do per-field analyzer to do special
> indexing:
> >
> > PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(..);
> > // PerFieldAnalyzerWrapper is subclass of Lucene's AnalyzerWrapper
> > IndexWriterConfig iwc = new IndexWriterConfig(analyzer);
> >
> > However, i found that later when i used MultiTerms.getTerms to load the
> > specific field's term dictionary, it's like it is still analyzed by
> > Lucene's StandardAnalyzer.
> >
> > I have to use another trick to bypass this problem(use
> > custom IndexableField class to do per-field custom analyzer, which is not
> > needed to detail here), i guess ultiTerms.getTerms is an experimental api
> > so it's not consistent with nalyzerWrapper?
> >
>
>
> --
> Adrien
>