use of org.opensearch.common.lucene.search.function.WeightFactorFunction in project OpenSearch by opensearch-project.
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