Hi,
I'm not sure if this is a good way to do it or not (so comments are
more than welcome!), but the way we have achieved this is using the
idea that a category/subcategory/subsubcategory etc create a path
that we associate with a document. This is the simple field
definition we use:
<fieldType name="category_facet" class="solr.TextField"
sortMissingLast="true" omitNorms="false">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.TrimFilterFactory" />
</analyzer>
</fieldType>
Then to search for all docs in say Electronics/Computers/Apple
We search submit a filter query something like:
fq=category_facet:Electronics/Computers/Apple
To get all computers we use:
fq=category_facet:Electronics/Computers*
Seems to work. I'd love to know what other people do?
Brendan
On Dec 10, 2007, at 8:54 AM, Sean Laval wrote:
eg. category/subcategory/subsubcategory?
such that if you search for category, you get all those documents
that have been tagged with the category AND any sub categories. If
this is possible I think I'll investigate using solr in place of
some existing code we have that deals with indexing and searching
of such data.
Regards,
Sean
_________________________________________________________________
Get free emoticon packs and customisation from Windows Live.
http://www.pimpmylive.co.uk