Hi, Nils.

We've implemented something like this here at ThingWorx, but we had to do so at 
a layer above Neo4J since there, of course, were no built-in faceting 
capabilities.  One of the major challenges we faced was the "opaque" connection 
from the Neo4J API to the underlying Lucene engine. There are quite a few 
things we would/could have done differently if we could access the underlying 
Lucene IndexReaders directly, but that isn't possible.  Nor would it probably 
be wise, since Neo4J's indexing framework does a lot of transaction isolation 
"magic" for Lucene that you'd run the risk of interfering with.

Also, you'll probably find that you need to implement faceting at a higher 
level anyway, since in Neo4J, the concept of a "document" in an index is merely 
its node or relationship ID - not the set of properties associated with it, so 
you'll need to do most of that work of reconstituting a document-oriented 
resultset elsewhere.

A few other things to consider:

- Cypher and/or Gremlin might provide ways to calculate individual facets via 
their aggregate functions.  The only problem with this approach is that you'd 
probably need to make multiple traversals to calculate multiple unrelated 
facets.  In "code" we can calculate those facets in a single pass

- We use HashSets quite pervasively to keep lists of unique results that were 
the intersection of multiple "searches" and to manage collections of facets.  
The LinkedHashSet has been very helpful since it preserves the order with which 
items were added

- Neo4J's index framework does not make it easy to (efficiently) get an 
exhaustive list of facet values/index values, if you're more interested in the 
key/value pairs and their frequency rather than the documents themselves

I think it would be a nice feature to the Neo4J Lucene index implementation if 
we could have access to the IndexReader/IndexWriter with some specific caveats 
on what is "safe" to do.  We contemplated hacking our own mods to the index 
framework to get access to this, but since we'd be missing the second part (the 
caveats), we felt like we'd just get into trouble.

Hope this helps.

Rick


-----Original Message-----
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Nils Kaiser
Sent: Thursday, December 08, 2011 6:59 AM
To: user@lists.neo4j.org
Subject: [Neo4j] Facetted search in neo4j

Hi,

I'm new to neo4j and graph databases and currently experimenting with a 
video sharing application. One thing I don't see mention on the neo4j 
list a lot is facetted search. Is it because it is trivial to implement 
using graphs? I've used solr before, where I can return both search 
results and facet info (number of objects that would match that facet 
given the current search terms / facet choices) on a single call, so 
quite a luxury and really easy to implement.

What would be the best approach with neo4j? I probably need to write a 
traversal that changes its stop conditions according to already entered 
search terms or facets, right? Anybody some examples or things to consider?

Thanks,

Nils

-- 
Nils Kaiser
MSc in Information Systems

_______________________________________________
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
_______________________________________________
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to