Ah, it's a bug allright... only when using the BatchInserterIndex. The
problem goes away if you add "provider":"lucene" to the configuration map,
like:
persons= indexProvider.nodeIndex("persons",
MapUtil.stringMap("type","exact",
"provider", "lucene"));
It will be fixed in M03, where the LuceneBatchInserterIndexProvider fills
that in for you.
2010/10/26 Peter Neubauer <[email protected]>
> Paddy,
> just tested it, and it seems it only occurs when running standalone,
> see the other mail. Seems to be a bug, and I think it is linked to the
> behavior seen in the Python bindings, too.
>
> Cheers,
>
> /peter neubauer
>
> VP Product Management, Neo Technology
>
> GTalk: neubauer.peter
> Skype peter.neubauer
> Phone +46 704 106975
> LinkedIn http://www.linkedin.com/in/neubauer
> Twitter http://twitter.com/peterneubauer
>
> http://www.neo4j.org - Your high performance graph database.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
>
> On Tue, Oct 26, 2010 at 3:56 AM, Paddy <[email protected]> wrote:
> > 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
> >
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>
--
Mattias Persson, [[email protected]]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user