use of io.crate.expression.reference.doc.lucene.FloatColumnReference in project crate by crate.
the class FloatColumnReferenceTest method testFieldCacheExpression.
@Test
public void testFieldCacheExpression() throws Exception {
FloatColumnReference floatColumn = new FloatColumnReference(column);
floatColumn.startCollect(ctx);
floatColumn.setNextReader(new ReaderContext(readerContext));
IndexSearcher searcher = new IndexSearcher(readerContext.reader());
TopDocs topDocs = searcher.search(new MatchAllDocsQuery(), 10);
float f = -0.5f;
for (ScoreDoc doc : topDocs.scoreDocs) {
floatColumn.setNextDocId(doc.doc);
assertThat(floatColumn.value(), is(f));
f++;
}
}
Aggregations