How to NOT parse a sentence in a lucene query parser?

I use the Lucene query parser for a simple search interface and I am having some problems. Each record that I keep has some fields that are parsed, and some fields that are not parsed.

When I try to use a query analyzer to create a query that scans as parsed, not parsed fields, the parser processes both fields, which means that the parsed field will never get a match.

Is there a way to tell the query analyzer NOT to parse the field?

+3
source share
1 answer

You can use PerFieldAnalyzerWrapper to define a specific analysis for each field. PerFieldAnalyzerWrapper should be used for both indexing and retrieval.

Alternatively, you can use Solr and define the analysis in the Solr schema.

+1
source

Source: https://habr.com/ru/post/1791049/


All Articles