Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Lucene to work with graph data

Is there a way to use Lucene to work with graph data?

Example

One user has a relationship with many lucene documents (Document Connections) One User has a relationship with other Users (User Connections [Graph])

If a user searches the Index, he gets back the documents that he has a relationship with. This is simple and straightforward.

What would be a way to get back the documents that the User Connections have a relationship with.

Indexing each document with all the user's that have a relationship with it in a user_id field is an approach. However when you query the index providing the User Connections for the user performing the search query size is unpredictable. Think of Users that have 1000's of User Connections. This will not scale.

It's almost like the User Connections and User Documents stored in a Graph DB can easily provide us the documents to search against but what is an effective way to communicate that to Lucene so it can only search against those documents for the given query. If any results are returned, this will guarantee that at least one or more of the User Connections has a relationship with the documents returned in the results.

like image 300
user1796571 Avatar asked Oct 21 '22 16:10

user1796571


1 Answers

I don't believe there is currently any graph technology that sits on top of solr or lucene.

You would probably be best looking at either one of these two camps:

  • Neo4j with SpringData (free for single instance)

OR

  • Tinkerpop Blueprints (possibly rexter if not using java/scala) on one of these technologies:
  • Titan on Cassandra with Hadoop (multi master, no point of failure)
  • OrientDb
  • Neo4j

These databases are graph databases. Tinkerpop Blueprints is a standard that allows you to abstract the specific implementation. Springdata currently only supports neo4j for graph technologies.

Neo4j costs money if you cluster (free license is single instance only).

You can read discussion on solr/lucene with graphing here. http://lucene.472066.n3.nabble.com/indexing-directed-graph-td2949556.html

Note neo4j supports full text search.

like image 171
JasonG Avatar answered Oct 25 '22 19:10

JasonG