apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.45k stars 973 forks source link

Enhance DisjunctionMaxQuery explanation to include details in case there was no match #13357

Closed AndreyBozhko closed 1 month ago

AndreyBozhko commented 1 month ago

Description

Currently, if the DisjunctionMaxQuery is used and the document did not match, the explanation from DisjunctionMaxWeight#explain only says No matching clause with no additional details (and the explanations from the subqueries are discarded).

In some use cases, it may be helpful to include individual "no-match" explanations from subqueries as they may provide more specific reason for why the document did not match.