I tracked down the error. There was still a left-over imported Lucene
3.0.2 in the library, which does not have the method  Hits
IndexSearcher.search(Query).

Thanks for the hint Peter!
Best,
Max

On Mon, Aug 2, 2010 at 3:11 PM, Max Jakob <[email protected]> wrote:
> Hi Peter,
>
>> this sounds like a version clash on Lucene. Can you check what
>> version(s) of Lucene (and Neo4j-Index) you are running in the two
>> scenarios?
>
> That would make sense to me as well. But like I said, on the first
> run, the method is found. Running the exact same code a second time,
> without any changes, it complains that the method is not found. (?!)
>
> Here the versions I use (for both runs) from my pom.xml:
>    <dependency>
>      <groupId>org.neo4j</groupId>
>      <artifactId>neo4j-kernel</artifactId>
>      <version>1.1-SNAPSHOT</version>
>    </dependency>
>    <dependency>
>      <groupId>org.neo4j</groupId>
>      <artifactId>neo4j-index</artifactId>
>      <version>1.1-SNAPSHOT</version>
>    </dependency>
>    <dependency>
>      <groupId>org.apache.lucene</groupId>
>      <artifactId>lucene-highlighter</artifactId>
>      <version>2.9.1</version>
>    </dependency>
>
> Cheers,
> Max
>
>
> On Mon, Aug 2, 2010 at 3:01 PM, Peter Neubauer
> <[email protected]> wrote:
>> Max,
>> this sounds like a version clash on Lucene. Can you check what
>> version(s) of Lucene (and Neo4j-Index) you are running in the two
>> scenarios?
>>
>> Cheers,
>>
>> /peter neubauer
>>
>> COO and Sales, 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 Mon, Aug 2, 2010 at 2:38 PM, Max Jakob <[email protected]> wrote:
>>> 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
>>>
>> _______________________________________________
>> Neo4j mailing list
>> [email protected]
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to