Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
6.0
-
None
-
None
-
None
-
New
Description
FunctionQuery.AllScorer.explain is:
public Explanation explain(int doc, float queryNorm) throws IOException { float sc = qWeight * vals.floatVal(doc); return Explanation.match(sc, "FunctionQuery(" + func + "), product of:", vals.explain(doc), Explanation.match(queryNorm, "boost"), Explanation.match(weight.queryNorm = 1f, "queryNorm")); }
The following line has a subtle assignment that overwrites weight.queryNorm.
Explanation.match(weight.queryNorm = 1f, "queryNorm"));
Because weights aren't reused between search and explain this doesn't break anything but it's awfully subtle.
Seeing as queryNorm is ALWAYS 1 here, could we just drop this extra line from the explain output and use the following instead?
public Explanation explain(int doc, float queryNorm) throws IOException { float sc = qWeight * vals.floatVal(doc); return Explanation.match(sc, "FunctionQuery(" + func + "), product of:", vals.explain(doc), Explanation.match(queryNorm, "boost")); }
Attachments
Issue Links
- is related to
-
LUCENE-7209 Fix FunctionQuery explanations
- Closed