lucene
lucene copied to clipboard
Made the UnifiedHighlighter's hasUnrecognizedQuery function processes FunctionQuery the same way as MatchAllDocsQuery and MatchNoDocsQuery queries for performance reasons.
Description
At Lexum, we deploy Solr with a slightly modified version of the UnifiedHighlighter: the FunctionQuery type is added as a knownLeaf to the QueryVisitor of the hasUnrecognizedQuery function (next to both MatchAllDocsQuery and MatchNoDocsQuery types). I wasn't there when the change was identified but it seems necessary for performance reasons. I propose the change, hoping that we don't need to maintain a slighty modified version of that class in our code base.
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!
This seems reasonable - FunctionQuery doesn't actually match things, it just scores, so it shouldn't be used for highlighting in any case.
Could you add a test to the highlighting module showing that including a FunctionQuery as a clause in a boolean query that has other highlightable clauses doesn't prevent those clauses from being correctly highlighted?
It might also be worth pulling the set of queries that get visited via visitLeaf() but are not unrecognized into an explicit set which we check, rather than using a list of instanceof clauses which might get longer in future.
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!