Included MatchNoDocsQuery in UH offset strategy check.

This commit is contained in:
Vincent Letard 2024-03-06 16:00:27 -05:00
parent 684a94caa5
commit e2a961a509
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -46,6 +46,7 @@ import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.FuzzyQuery;
import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.PrefixQuery;
import org.apache.lucene.search.Query; import org.apache.lucene.search.Query;
@ -1704,7 +1705,7 @@ public class TestUnifiedHighlighter extends UnifiedHighlighterTestBase {
String[] snippets = highlighter.highlight("body", query, topDocs); String[] snippets = highlighter.highlight("body", query, topDocs);
for (Query noEffectQuery: new Query[] {new MatchAllDocsQuery(), new FunctionQuery(new ConstValueSource(5))}) { for (Query noEffectQuery: new Query[] {new MatchAllDocsQuery(), new MatchNoDocsQuery(), new FunctionQuery(new ConstValueSource(5))}) {
final Query booleanQuery = new BooleanQuery.Builder() final Query booleanQuery = new BooleanQuery.Builder()
.add(noEffectQuery, BooleanClause.Occur.MUST) .add(noEffectQuery, BooleanClause.Occur.MUST)
.add(query, BooleanClause.Occur.MUST) .add(query, BooleanClause.Occur.MUST)