On 11/2/06, David Legg <[EMAIL PROTECTED]> wrote:
I've just discovered Solr and realized its potential!

Welcome!

My main interest
is in Solr's fledgling support for faceted search.

Are there any ideas on how to support hierarchical facets?

I've thought of some optimizations and general approach (not yet
implemented) when it's a strict hierarchy.

Store the full tag path as a single value w/ a special separator:
"United States/Massachusetts/Boston"

That allows one to use the FieldCache (which maps a document back to a
single field value... can only be used for single-valued non-tokenized
fields).

The existing facet.field functionality could be used to return counts
of unique values, and the Solr client (front-end) could sum everything
under Massachusetts to get a count for Massachusetts itself, etc.

An alternative would be to add the concept of a strict facet hierarchy
into Solr, and it could do the summing itself (useful if there are too
many leaves to return them all to the client).

For narrowing search results (specifying filter queries via fq), one
could use prefix queries for higher level categories:
fq=location:United States/Massachusetts/*


So in short, I think it's already doable with what's there, but could
be made more efficient.

-Yonik

Reply via email to