There should never be a need to implement your own GraphDatabaseService or IndexManager... instead these are the things to do to provide your own index implementation:
- Create your own SphinxIndexProvider, inspired by LuceneIndexProvider<https://svn.neo4j.org/components/lucene-index/trunk/src/main/java/org/neo4j/index/impl/lucene/LuceneIndexProvider.java>. It will extend IndexProvider<http://components.neo4j.org/neo4j-examples/1.2.M02/apidocs/org/neo4j/graphdb/index/IndexProvider.html>which gets loaded together with the kernel and can therefore participate in recovery. - Specify a unique service name f.ex. "sphinx". - When creating indexes<http://components.neo4j.org/neo4j-examples/1.2.M02/apidocs/org/neo4j/graphdb/index/IndexManager.html#forNodes%28java.lang.String,%20java.util.Map%29>(accessing for the first time) supply "provider": "sphinx" in that config map. Or put neo4j config (to your EmbeddedGraphDatabase) "index": "sphinx" so that the provider by default is "sphinx"... then you can just use the normal accessor, i.e. graphDb.index().forNodes( "my-index" ). - Make sure you have an META-INF/services/org.neo4j.kernel.KernelExtension containing your SphinxIndexProvider (common java service API thingie). The XaDataSource/XaConnection/XaResource implementation needed to implement an index is a bit tedious and is bound to be simplified in the future. Until then you can just look at how the LuceneIndexProvider does things and copy that. This information is, as you pointed out, missing from the wiki page... I'll add it! 2010/11/3 Balazs E. Pataki <pat...@dsd.sztaki.hu> > Hi, > > we are trying to use the Sphinx indexer with neo4j. With the old API we > could implement an IndexProvider and do indexing on Nodes created by any > GraphDatabaseService (eg. EmbeddedGraphDatabase). > > Now with the new 1.2M02 milestone release there is the "Index > Framework", which is integrated with the GraphDatabaseService. However, > I cannot see how we can now replace the LuceneIndexer implementation > with our SphinxIndexer. The GraphDatabaseService API has an index() > method, which returns an IndexManager and via which you can do the > indexing. There, however, seems no way to provide a different > IndexManager unless we create a new GraphDatabaseService implementation, > eg. by wrapping EmbeddedGraphDatabase and overriding the index() method. > > Is it the supposed way of adding a new indexer to neo4j 1.2M2, or is > there a better way? > > Thanks for any hints in advance! > --- > balazs > > _______________________________________________ > 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