I'm using the PayloadTermQuery and scoring documents using a custom algorithm based on the payloads of the matching terms. The algorithm is implemented in the custom PayloadFunction and I have added an Override for the explain. However, the PayloadTermWeight explanation hides the details of the payload score...
Explanation payloadExpl = new Explanation(scorer.getPayloadScore(), "scorePayload(...)"); This is different than the way that PayloadNearSpanWeight explains the payload. It actually asks the payload function for the explanation rather than hiding it: Explanation payloadExpl = function.explain(doc, scorer.payloadsSeen, scorer.payloadScore); This seems like a bug/oversight. Should this be a JIRA issue, or is this intended? The fix is obviously very simple (just ask the PayloadFunction as in the PayloadNearSpanWeight). - Scott