On Thu, 2011-06-30 at 11:38 +0200, Russell B wrote:
> a multivalued field labelled category which for each document defines
> where in the tree it should appear.  For example: doc1 has the
> category field set to "0/topics", "1/topics/computing",
> "2/topic/computing/systems".
> 
> I then facet on the 'category' field, filter the results with fq={!raw
> f=category}1/topics/computing to get everything below that point on the
> tree, and use f.category.facet.prefix to restrict the facet fields to the
> current level.

Lucid Imagination did a webcast on this, as far as I remember?

> Playing around with the results, it seems to work ok but despite reading
> lots about faceting I can't help feel there might be a better solution.

The '1/topics/computing'-solution works at a single level, so if you are
interested in a multi-level result like
- topic
 - computing
  - hardware
  - software
 - biology
  - plants
  - animals
you have to do more requests.

> Are there better ways to achieve this?

Taxonomy faceting is a bit of a mess right now, but it is also an area
where a lot is happening. For SOLR, there is

https://issues.apache.org/jira/browse/SOLR-64
(single path/document hierarchical faceting)

https://issues.apache.org/jira/browse/SOLR-792
(pivot faceting, now part of trunk AFAIR)

https://issues.apache.org/jira/browse/SOLR-2412
(multi path/document hierarchical faceting, very experimental)

Just yesterday, another multi path/document hierarchical faceting
solution was added to the Lucene 3.x branch and Lucene trunk. It has
been used by IBM for some time and appears to be mature and stable.
https://issues.apache.org/jira/browse/LUCENE-3079
However, this solution requires a sidecar index for the taxonomy and I
am a bit worried about how this fits into the Solr index workflow.

Reply via email to