Question

Even though LuceneIndexService takes GraphDataBaseService as an input parameter but it works only on EmbeddedGraphDatabase. However, It doesn't seem to work with RemoteGraphDatabase is it possible to do so ...

Was it helpful?

Solution

For RemoteGraphDatabase there is an implementation of the IndexService called RemoteIndexService. In order to use it you need to first create and expose the IndexService on the server:

EmbeddedGraphDatabase graphDb = ...
IndexService index = new LuceneIndexService(graphDb);
BasicGraphDatabaseServer server = new LocalGraphDatabase(graphDb);
server.registerIndexService(index, "lucene index");
// Expose the server through RMI as usual...

Then on the client side you would do:

RemoteGraphDatabase graphDb = ...
IndexService index = new RemoteIndexService(graphDb, "lucene index");
// business as usual...

The next update of RemoteGraphDatabase will use the new index API of Neo4j introduced in 1.2, that will make this much more convenient.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top