Hi,
I'm trying out the new Index Framework Batch Inserter using version 1.2.M02.
I getting a "No index provider 'null' found" error when calling
graphDb.index().forNodes("persons") in my test code below
Exception in thread "main" java.lang.IllegalArgumentException: No index
provider 'null' found
at
org.neo4j.kernel.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:65)
at org.neo4j.kernel.IndexManagerImpl.forNodes(IndexManagerImpl.java:205)
at
ie.transportdublin.batchinserter.BatchIndexTest.main(BatchIndexTest.java:40)
>From debugging it looks like config.get( KEY_INDEX_PROVIDER )@ L205 in
IndexManagerImpl
is returning a null value.
Or please let me know if I should be doing this a different way.
thanks
Paddy
public class BatchIndexTest {
static final String DB_PATH = "data/neo-db-test10";
static BatchInserterIndexProvider indexProvider;
static BatchInserter inserter;
static BatchInserterIndex persons ;
static GraphDatabaseService graphDb;
public static void main(String[] args) {
inserter = new BatchInserterImpl(DB_PATH);
indexProvider = new LuceneBatchInserterIndexProvider(inserter);
persons= indexProvider.nodeIndex("persons", MapUtil.stringMap("type",
"exact"));
Map<String, Object> properties = MapUtil.map("name", "test");
long node = inserter.createNode(properties);
persons.add(node, properties);
indexProvider.shutdown();
inserter.shutdown();
graphDb = new EmbeddedGraphDatabase(DB_PATH);
Transaction tx = graphDb.beginTx();
try {
IndexManager indexManager = graphDb.index();
System.out.println(indexManager.forRelationships("persons"));
System.out.println(indexManager.existsForNodes("persons")); //returns true
//Getting an error with the following code
System.out.println(indexManager.forNodes("persons"));
tx.success();
} finally {
tx.finish();
graphDb.shutdown();
}
}
}
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user