Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
7.2.1
-
None
-
None
-
New
Description
If a queryText produces zero tokens after being processed by an Analyzer, when you try to build a Query with it the result is null.
The following code reproduces this bug:
public class LuceneBug { public Query buildQuery() throws IOException { Analyzer analyzer = CustomAnalyzer.builder() .withTokenizer(StandardTokenizerFactory.class) .addTokenFilter(StopFilterFactory.class) .build(); QueryBuilder queryBuilder = new QueryBuilder(analyzer); String onlyStopWords = "the and it"; return queryBuilder.createPhraseQuery("AnyField", onlyStopWords); } }