(As I answered in another thread)

This is a bug in the LuceneIndexBatchInserterIndexProvider class where it
doesn't automatically fill in the "provider" parameter. It has been fixed
now, so until M03 send that in yourself... just like the tests do.

I'm not sure this is connected to the python problems, since the python
bindings hasn't been updated to use the new index API, and is even
batchinsertion possible in neo4j.py? I think it's not.

2010/10/26 Peter Neubauer <peter.neuba...@neotechnology.com>

> Hi all,
> there are two cases (from python and Paddys code below) where a
> created index is not found. I have been trying to track it down, but
> cannot reproduce it using the code at
>
> https://trac.neo4j.org/browser/components/lucene-index/trunk/src/test/java/org/neo4j/index/impl/lucene/TestLuceneBatchInsert.java#L178
>
> Somehow the index config in the main() code is getting result =
> ({type=exact}, false) back from
> IndexManagerImpl.getOrCreateIndexConfig()
>
> Pair<Map<String, String>, Boolean> result = findIndexConfig( cls,
>                indexName, suppliedConfig,
> graphDbImpl.getConfig().getParams() );
>
> , when before (upon the first creation) it was ({provider=lucene,
> type=exact}, false). This is not happening in the unit test.
>
> Also, this might be linked to the Python index issue earlier mentioned
> on the list?
>
>
> package org.neo4j;
>
> import java.util.Map;
>
> import org.neo4j.graphdb.GraphDatabaseService;
> import org.neo4j.graphdb.Node;
> import org.neo4j.graphdb.Transaction;
> import org.neo4j.graphdb.index.BatchInserterIndex;
> import org.neo4j.graphdb.index.BatchInserterIndexProvider;
> import org.neo4j.graphdb.index.Index;
> import org.neo4j.graphdb.index.IndexManager;
> import org.neo4j.helpers.collection.MapUtil;
> import org.neo4j.index.impl.lucene.LuceneBatchInserterIndexProvider;
> import org.neo4j.kernel.EmbeddedGraphDatabase;
> import org.neo4j.kernel.impl.batchinsert.BatchInserter;
> import org.neo4j.kernel.impl.batchinsert.BatchInserterImpl;
>
> public class BatchIndexTest
> {
>
>    static final String DB_PATH = "target/db";
>    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
>            Index<Node> nodes = indexManager.forNodes( "persons" );
>            System.out.println( nodes );
>
>            tx.success();
>        }
>        finally
>        {
>            tx.finish();
>            graphDb.shutdown();
>        }
>    }
> }
>
> Cheers,
>
> /peter neubauer
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to