use of org.apache.lucene.queries.function.valuesource.IDFValueSource in project lucene-solr by apache.
the class TestValueSources method testIDF.
public void testIDF() throws Exception {
Similarity saved = searcher.getSimilarity(true);
try {
searcher.setSimilarity(new ClassicSimilarity());
ValueSource vs = new IDFValueSource("bogus", "bogus", "text", new BytesRef("test"));
assertHits(new FunctionQuery(vs), new float[] { 1.0f, 1.0f });
assertAllExist(vs);
} finally {
searcher.setSimilarity(saved);
}
}
Aggregations