Search in sources :

Example 1 with LuceneBatchInserterIndexProvider

use of org.neo4j.index.impl.lucene.LuceneBatchInserterIndexProvider in project graphdb by neo4j-attic.

the class ImdbExampleTest method batchInsert.

@Test
public void batchInsert() {
    // START SNIPPET: batchInsert
    BatchInserter inserter = new BatchInserterImpl("target/neo4jdb-batchinsert");
    BatchInserterIndexProvider indexProvider = new LuceneBatchInserterIndexProvider(inserter);
    BatchInserterIndex actors = indexProvider.nodeIndex("actors", MapUtil.stringMap("type", "exact"));
    actors.setCacheCapacity("name", 100000);
    Map<String, Object> properties = MapUtil.map("name", "Keanu Reeves");
    long node = inserter.createNode(properties);
    actors.add(node, properties);
    // Make sure to shut down the index provider
    indexProvider.shutdown();
    inserter.shutdown();
// END SNIPPET: batchInsert
}
Also used : BatchInserter(org.neo4j.kernel.impl.batchinsert.BatchInserter) BatchInserterImpl(org.neo4j.kernel.impl.batchinsert.BatchInserterImpl) BatchInserterIndexProvider(org.neo4j.graphdb.index.BatchInserterIndexProvider) LuceneBatchInserterIndexProvider(org.neo4j.index.impl.lucene.LuceneBatchInserterIndexProvider) LuceneBatchInserterIndexProvider(org.neo4j.index.impl.lucene.LuceneBatchInserterIndexProvider) BatchInserterIndex(org.neo4j.graphdb.index.BatchInserterIndex) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BatchInserterIndex (org.neo4j.graphdb.index.BatchInserterIndex)1 BatchInserterIndexProvider (org.neo4j.graphdb.index.BatchInserterIndexProvider)1 LuceneBatchInserterIndexProvider (org.neo4j.index.impl.lucene.LuceneBatchInserterIndexProvider)1 BatchInserter (org.neo4j.kernel.impl.batchinsert.BatchInserter)1 BatchInserterImpl (org.neo4j.kernel.impl.batchinsert.BatchInserterImpl)1