Package io.crate.operation.reference.doc.lucene

Examples of io.crate.operation.reference.doc.lucene.BytesRefColumnReference


        return new FieldDataType("string");
    }

    @Test
    public void testFieldCacheExpression() throws Exception {
        BytesRefColumnReference bytesRefColumn = new BytesRefColumnReference(fieldName().name());
        bytesRefColumn.startCollect(ctx);
        bytesRefColumn.setNextReader(readerContext);
        IndexSearcher searcher = new IndexSearcher(readerContext.reader());
        TopDocs topDocs = searcher.search(new MatchAllDocsQuery(), 20);
        int i = 0;
        StringBuilder builder = new StringBuilder();
        for (ScoreDoc doc : topDocs.scoreDocs) {
            builder.append(i);
            bytesRefColumn.setNextDocId(doc.doc);
            assertThat(bytesRefColumn.value().utf8ToString(), is(builder.toString()));
            i++;
        }
    }
View Full Code Here

TOP

Related Classes of io.crate.operation.reference.doc.lucene.BytesRefColumnReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.