-
Type:
Bug
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 6.0
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Lucene Fields:New
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")); }
- is related to
-
LUCENE-7209 Fix FunctionQuery explanations
-
- Closed
-