3
votes

I'm using the Lucene query parser for a simple search front-end and I'm running into some problems. Each record that I'm storing has some fields that are analyzed and some fields that are not analyzed.

When I try to use the query parser to construct a query that looks over both the analyzed an not analyzed fields, the analyzer is processing both fields, which means that the non-analyzed field will never get a match.

Is there any way to tell the query parser to NOT analyze a field?

1

1 Answers

1
votes

You can use a PerFieldAnalyzerWrapper for defining specific analysis per field. The PerFieldAnalyzerWrapper should be used both for indexing and retrieval.

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