Hi,

I have a problem with the LuceneIndexService. When I create an indexed
graph base and I commit it to disk, next time I want to use it, I get
a NoSuchMethodError for LuceneIndexService.getSingleNode:

Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.lucene.search.IndexSearcher.search(Lorg/apache/lucene/search/Query;)Lorg/apache/lucene/search/Hits;
        at 
org.neo4j.index.lucene.LuceneIndexService.searchForNodes(LuceneIndexService.java:430)
        at 
org.neo4j.index.lucene.LuceneIndexService.getNodes(LuceneIndexService.java:310)
        at 
org.neo4j.index.lucene.LuceneIndexService.getSingleNode(LuceneIndexService.java:469)
        at 
org.neo4j.index.lucene.LuceneIndexService.getSingleNode(LuceneIndexService.java:461)

To illustrate this in more detail: if I run the code below for the
first time, everything goes fine. On a second run I get the exception.
Could somebody give me a hint where I'm going wrong? (re-indexing does
not work) Do I have to initialize the LuceneIndexService differently
if the index is already on disk?

Thanks in advance for any advice you have,
Max


GraphDatabaseService graphDb = new EmbeddedGraphDatabase("gbDir");
IndexService index = new LuceneIndexService(graphDb);
Transaction tx = graphDb.beginTx();
try {
    Node node = index.getSingleNode("name", "testName");
    if (node == null) {
        node = graphDb.createNode();
        node.setProperty("name", "testName");
        index.index(node, "name", "testName");
    }
    tx.success()
}
finally {
    tx.finish();
    index.shutdown();
    graphDb.shutdown();
}
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to