Merge remote-tracking branch 'laurent/functionquery-as-unrecognizedquery-in-unifiedhighlighter' into functionquery-as-unrecognizedquery-in-unifiedhighlighter

This commit is contained in:
Vincent Letard 2024-03-06 13:29:07 -05:00
commit c16bd20cc0
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -49,6 +49,7 @@ import org.apache.lucene.index.StoredFieldVisitor;
import org.apache.lucene.index.StoredFields;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.TermVectors;
import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.spans.SpanQuery;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexSearcher;
@ -1130,7 +1131,9 @@ public class UnifiedHighlighter {
@Override
public void visitLeaf(Query query) {
if (MultiTermHighlighting.canExtractAutomataFromLeafQuery(query) == false) {
if (!(query instanceof MatchAllDocsQuery || query instanceof MatchNoDocsQuery)) {
if (!(query instanceof MatchAllDocsQuery
|| query instanceof MatchNoDocsQuery
|| query instanceof FunctionQuery)) {
hasUnknownLeaf[0] = true;
}
}