use of org.elasticsearch.common.lucene.search.function.LeafScoreFunction in project elasticsearch by elastic.
the class FunctionScoreTests method testWeightFactorNeedsScore.
public void testWeightFactorNeedsScore() {
for (boolean needsScore : new boolean[] { true, false }) {
WeightFactorFunction function = new WeightFactorFunction(10.0f, new ScoreFunction(CombineFunction.REPLACE) {
@Override
public LeafScoreFunction getLeafScoreFunction(LeafReaderContext ctx) throws IOException {
return null;
}
@Override
public boolean needsScores() {
return needsScore;
}
@Override
protected boolean doEquals(ScoreFunction other) {
return false;
}
@Override
protected int doHashCode() {
return 0;
}
});
assertEquals(needsScore, function.needsScores());
}
}
Aggregations