Neo4j Wiki から
This refers to the old index API. Please look at the integrated index framework instead.
If you're looking for information about IndexService then go to Indexing with IndexService.
 Differences from IndexService
The LuceneIndexBatchInserter is designed for being performant when inserting large amounts of data with minimal lookups from the index during that time. You typically do a one-time batch insertion of a big amount of data and then when you have that data inserted you use an IndexService (together with a GraphDatabaseService) from there on. Just as the BatchInserter it doesn't support transactions or multiple threads, just to squeeze out more performance. You're expected to shut down the index nicely when you're done otherwise there's no guarantee that your data will be stored correctly.
BatchInserter inserter = new BatchInserterImpl( "path/to/neo4j-db" ); LuceneIndexBatchInserter index = new LuceneIndexBatchInserterImpl( inserter ); Map<String, Object> properties = Collections.<String, Object>singletonMap( "name", "Thomas Andersson" ); long thomasId = inserter.createNode( properties ); index.index( thomasId, "name", properties.get( "name" ) );
 Typical usage
You should use your LuceneIndexBatchInserter in a more restricted way than an IndexService to get it to perform better. Here are some pointers to get it right.
- Try to avoid mixing reads with writes since there's a performance penalty in getNodes() each time the index has changed, due to the usage of the reopen functionality in lucene.
- Have (as big as possible) phases where one phase is either only writes or only reads.
- Use optimize() to speed up your read phase. It should only be used after a write phase when you've done all your writing for that phase.