Closed timgrein closed 1 month ago
This could make explanations harder to read for large queries, e.g. queries produced through rewriting. I wonder about doing something in-between such as only including the non-matching subs if the query doesn't match, what do you think?
This could make explanations harder to read for large queries, e.g. queries produced through rewriting. I wonder about doing something in-between such as only including the non-matching subs if the query doesn't match, what do you think?
Fair point! Adjusted the PR accordingly and added an additional test for the in-between behavior.
Thanks for the reviews! Added it to the improvement section ✅ @jpountz
Closes https://github.com/apache/lucene/issues/13357
Description
https://github.com/apache/lucene/issues/13357 states that it's useful to have the explanations of the sub queries of
DisjuncationMaxQuery
present, even if the document didn't match. Considering that other queries likeCoveringQuery
also include explanations, if the document didn't match I've adjusted the logic according to the issue's proposal.Also added tests for
explain
(match and no match case). I've also adjustedCheckHits#verifyExplanation
to only check sub explanations, if the overall explanation returned a hit and scores need to be checked.