use of org.neo4j.kernel.api.impl.index.partition.PartitionSearcher in project neo4j by neo4j.
the class NonUniqueDatabaseIndexSamplerTest method samplingOfLargeNumericValues.
@Test
public void samplingOfLargeNumericValues() throws Exception {
try (RAMDirectory dir = new RAMDirectory();
WritableIndexPartition indexPartition = new WritableIndexPartition(new File("testPartition"), dir, IndexWriterConfigs.standard())) {
insertDocument(indexPartition, 1, Long.MAX_VALUE);
insertDocument(indexPartition, 2, Integer.MAX_VALUE);
indexPartition.maybeRefreshBlocking();
try (PartitionSearcher searcher = indexPartition.acquireSearcher()) {
NonUniqueLuceneIndexSampler sampler = new NonUniqueLuceneIndexSampler(searcher.getIndexSearcher(), taskControl.newInstance(), new IndexSamplingConfig(Config.empty()));
assertEquals(new IndexSample(2, 2, 2), sampler.sampleIndex());
}
}
}
Aggregations