use of org.apache.lucene.queries.function.valuesource.MaxFloatFunction in project lucene-solr by apache.
the class TestValueSources method testMaxFloat.
public void testMaxFloat() throws Exception {
ValueSource vs = new MaxFloatFunction(new ValueSource[] { new ConstValueSource(1f), new ConstValueSource(2f) });
assertHits(new FunctionQuery(vs), new float[] { 2f, 2f });
assertAllExist(vs);
// as long as one value exists, then max exists
vs = new MaxFloatFunction(new ValueSource[] { BOGUS_FLOAT_VS, new ConstValueSource(2F) });
assertAllExist(vs);
vs = new MaxFloatFunction(new ValueSource[] { BOGUS_FLOAT_VS, new ConstValueSource(2F), BOGUS_DOUBLE_VS });
assertAllExist(vs);
// if none exist, then max doesn't exist
vs = new MaxFloatFunction(new ValueSource[] { BOGUS_FLOAT_VS, BOGUS_INT_VS, BOGUS_DOUBLE_VS });
assertNoneExist(vs);
}
Aggregations