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