You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Sphene Software <sp...@gmail.com> on 2012/03/14 14:12:00 UTC
Dynamically changing facet hierarchies and facet values
Hello,
I have a use case where the facet hierarchies as well as facet names change
very frequently.
For example:
(Smartphones >> Android ) may become
Smartphones >> GSM >> And roid.
OR
"Smartphone" could be renamed to "Smart Phone"
If I use traditional hierarchical faceting, then every change would mean a
re-index of a large number of documents.
Just curious to know how others have solved this problem in the past.
Appreciate your help!
Sphene
Re: Dynamically changing facet hierarchies and facet values
Posted by Chris Hostetter <ho...@fucit.org>.
: I have a use case where the facet hierarchies as well as facet names change
: very frequently.
:
: For example:
: (Smartphones >> Android ) may become
: Smartphones >> GSM >> And roid.
:
: OR
: "Smartphone" could be renamed to "Smart Phone"
:
: If I use traditional hierarchical faceting, then every change would mean a
: re-index of a large number of documents.
:
: Just curious to know how others have solved this problem in the past.
I've dealt with this in the past using a custom plugin for the faceting.
basically each document had a category field that only contained the id#
of a category it was directly in, and the actaul hierarchy info was stored
in an XML data file that the plugin loaded at init and used to build the
query associated with each node by looking at all the categoryId number
from all hte descendent categories (optimizations can be made if you know
documents are only mapped to leaf level categories, or if you can define
your hierarchy in terms of other fields -- ie: catId#345might be definable
by the query "type:phone AND os:android AND tech:GSM")
for small hiarchies, you can do the same thing from any solr client that
knows what hierarchy you have usng many facet.queries - just put whatever
info you need to remap the flat facet.query responses into a hierarchy as
localparams on each facet.query.
-Hoss