Hi: FunctionQuery. AllScorer. Score () method, If it is less than 0, it returns 0 points. But sometimes you have to compute a negative score.
If it were the case, there would be no negative points. Can a global variable be turned on to control whether it has a negative score, compatible with different requirements. public float score() throws IOException { float val = vals.floatVal(docID()); if (val >= 0 == false) { // this covers NaN as well since comparisons with NaN return false return 0; } else { return boost * val; } }