Hoss, thanks for the pointer to
:: Still it would disturb to declare a "negative score" as a "match".
... no idea what you ment there.
Assume a boolean query that contains a BTQ, among other things.
The score of a doc is a sum over several scores, all elements are positive, except the BTQ element which is negative.
The total sum is positive and hence (say) was accepted by the collector in effect.
As the code is right now, the explanation for the boolean query would ignore the (negative) BTQ part and its value would differ that of the actual search.
Fixing BTQ to return a complex explanation and calling setMatch(True) will fix the score difference, and now the BQ explanation would also contain the sub-expl of the BTQ. Great. This also makes perfect sense in BTQ, because the way the score is computed, it can be negative or even 0. I'll open a separate issue for fixing BTQ.
The one thing that bothers me still is that the BTQ sub-expl would print as MATCH when in fact it just hurts the current doc score (apparently "not enough"). Would it be more correct for the (negative) BTQ part to say "NON-MATCH"?