Hi Chetan,

sorry for the late reply, the ShingleFilter is intended to be used only at
indexing time, that's why I changed only the code there.
The PerFieldAnalyzerWrapper will continue using the configured or default
analyzers for other fields.

Regards,
Tommaso

2015-09-02 12:34 GMT+02:00 Chetan Mehrotra <[email protected]>:

> Hi Tommaso,
>
> On Wed, Sep 2, 2015 at 1:28 PM,  <[email protected]> wrote:
> > +            Analyzer definitionAnalyzer = definition.getAnalyzer();
> > +            Map<String, Analyzer> analyzers = new HashMap<String,
> Analyzer>();
> > +            analyzers.put(FieldNames.SPELLCHECK, new
> ShingleAnalyzerWrapper(LuceneIndexConstants.ANALYZER, 3));
> > +            Analyzer analyzer = new
> PerFieldAnalyzerWrapper(definitionAnalyzer, analyzers);
> > +            IndexWriterConfig config = new IndexWriterConfig(VERSION,
> analyzer);
>
> Have a look at IndexDefinition#createAnalyzer which already creates a
> PerFieldAnalyzerWrapper. So would be better to move this logic there.
> Or you want to customize the analyzer for that field only during
> indexing.
>
> Chetan Mehrotra
>

Reply via email to