use of io.crate.operation.reference.doc.lucene.ShortColumnReference in project crate by crate.
the class ShortColumnReferenceTest method testShortExpression.
@Test
public void testShortExpression() throws Exception {
ShortColumnReference shortColumn = new ShortColumnReference(column);
shortColumn.startCollect(ctx);
shortColumn.setNextReader(readerContext);
IndexSearcher searcher = new IndexSearcher(readerContext.reader());
TopDocs topDocs = searcher.search(new MatchAllDocsQuery(), 20);
short i = -10;
for (ScoreDoc doc : topDocs.scoreDocs) {
shortColumn.setNextDocId(doc.doc);
assertThat(shortColumn.value(), is(i));
i++;
}
}
Aggregations