use of org.neo4j.unsafe.batchinsert.BatchInserterIndex in project neo4j by neo4j.
the class LegacyIndexTest method legacyIndexPopulationWithBunchOfFields.
@Test(timeout = TEST_TIMEOUT)
public void legacyIndexPopulationWithBunchOfFields() throws Exception {
BatchInserter batchNode = BatchInserters.inserter(directory.graphDbDir());
LuceneBatchInserterIndexProvider provider = new LuceneBatchInserterIndexProvider(batchNode);
try {
BatchInserterIndex batchIndex = provider.nodeIndex("node_auto_index", stringMap(IndexManager.PROVIDER, "lucene", "type", "fulltext"));
Map<String, Object> properties = new HashMap<>();
for (int i = 0; i < 2000; i++) {
properties.put(Integer.toString(i), RandomStringUtils.randomAlphabetic(200));
}
long node = batchNode.createNode(properties, Label.label("NODE"));
batchIndex.add(node, properties);
} finally {
provider.shutdown();
batchNode.shutdown();
}
}
Aggregations