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