thats perfect, i should of looked at the tests, Thanks Mattias

On Sat, Sep 25, 2010 at 8:17 AM, Mattias Persson
<matt...@neotechnology.com>wrote:

> Well, you should either go with neo4j-index or neo4j-lucene-index since
> they
> don't share any state together and versions and classes may be conflicting.
> This particular error (IncompatibleClassChangeError in SimpleIndexHits) is
> caused by having both the index jar files on the classpath and at runtime
> it's a matter of randomness which of the two SimpleIndexHits class it loads
> (either in neo4j-index or neo4j-lucene-index) since they are named the
> exact
> same thing in both packages, but the one in neo4j-lucene-index has been
> extended... so it seems it tried to load the one from neo4j-index although
> the neo4j-lucene-index one was really needed.
>
> So, are you going to use the new index framework then use it and leave
> neo4j-index behind. For batch insertions please use
>
> https://svn.neo4j.org/laboratory/components/lucene-index/trunk/src/main/java/org/neo4j/index/impl/lucene/LuceneBatchInserterIndexProvider.javaand
> then
>
> https://svn.neo4j.org/laboratory/components/lucene-index/trunk/src/main/java/org/neo4j/index/impl/lucene/LuceneIndexProvider.javafor
> normal use.
>
> Tests for the batch inserter are in
>
> https://svn.neo4j.org/laboratory/components/lucene-index/trunk/src/test/java/org/neo4j/index/impl/lucene/TestLuceneBatchInsert.javawhich
> would serve as documentation at the moment :)
>
> 2010/9/24 Paddy <paddyf...@gmail.com>
>
> > Hi Mattias,
> > i just had neo4j-lucene-index 0.1-SNAPSHOT in the CLASSPATH  when i got
> the
> > first error
> > but when i include 1.2-SNAPSHOT & 0.1-SNAPSHOT and query the graph
> created
> > using:
> >
> > Index<Node> myIndex = provider.nodeIndex("fulltext",
> > LuceneIndexProvider.FULLTEXT_CONFIG);
> > for (Node searchHit : myIndex.query("Id:time")) {
> > }
> >
> > i get an error:
> >
> > Exception in thread "main" java.lang.IncompatibleClassChangeError: Class
> > org.neo4j.index.impl.SimpleIndexHits does not implement the requested
> > interface org.neo4j.graphdb.index.IndexHits
> > at neo4j.indexTest3.main(indexTest3.java:24)
> >
> > I'm just not sure what i need to include in the CLASSPATH to insert and
> > index nodes using the BatchInserter,
> >  which are then compatible to be queried using the new
> LuceneIndexProvider
> > ?
> >
> > thanks
> > Paddy
> >
> > On Thu, Sep 23, 2010 at 4:45 PM, Mattias Persson
> > <matt...@neotechnology.com>wrote:
> >
> > > Your code doesn't use the new index framework, but there might be a
> > > CLASSPATH issue where the neo4j-index 1.1 uses lucene 2.9.2 and
> > > neo4j-lucene-index 0.1-SNAPSHOT uses lucene 3.0.1. If you've got 'em
> both
> > > on
> > > the classpath there might be problems, so please use the one or the
> > other.
> > > Or you could use neo4j-index 1.2-SNAPSHOT where this issue isn't a
> > problem
> > > anymore since it's updated to lucene 3.0.1 as well.
> > >
> > > 2010/9/24 Paddy <paddyf...@gmail.com>
> > >
> > > > Hi,
> > > > I got the following error when trying out the
> > > > neo4j-lucene-index 0.1-SNAPSHOT with the BatchInserter, it worked ok
> > when
> > > > using the neo4j-index 1.1.
> > > > The problem is when i call: indexService.getSingleNode("Id", "test");
> > > > should
> > > > i modify my code to use the new neo4j-lucene-index with
> > > > the the BatchInserter?
> > > >
> > > > Thanks
> > > > Paddy
> > > >
> > > > 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.LuceneIndexBatchInserterImpl.getNodes(LuceneIndexBatchInserterImpl.java:239)
> > > > at
> > > >
> > > >
> > >
> >
> org.neo4j.index.lucene.LuceneIndexBatchInserterImpl.getSingleNode(LuceneIndexBatchInserterImpl.java:279)
> > > > at neo4j.indexTest2.main(indexTest2.java:42)
> > > >
> > > >
> > > > public class indexTest2 {
> > > > static GraphDatabaseService gds;
> > > > static LuceneFulltextIndexBatchInserter indexService;
> > > > static BatchInserter inserter;
> > > >
> > > > public static void setup() {
> > > > inserter = new BatchInserterImpl("data/neodb/neodb-tmp",
> > > BatchInserterImpl
> > > > .loadProperties("neo4j_config.props"));
> > > > indexService = new LuceneFulltextIndexBatchInserter(inserter);
> > > >
> > > > }
> > > >
> > > > public static void main(String[] args) {
> > > > setup();
> > > >
> > > > Map<String, Object> nodeProperties = new TreeMap<String, Object>();
> > > > nodeProperties.put("Id", "test");
> > > > long node = inserter.createNode(nodeProperties);
> > > > indexService.index(node, "Id", "test");
> > > >
> > > > long search = indexService.getSingleNode("Id", "test");
> > > > System.out.println("Search" + search);
> > > >
> > > > inserter.shutdown();
> > > > indexService.optimize();
> > > > indexService.shutdown();
> > > >
> > > > }
> > > > }
> > > > _______________________________________________
> > > > 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
> > >
> > _______________________________________________
> > 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
>
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to