lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nea <neap...@me.com>
Subject Re: HierarchicalFaceting for Ecommerce Categories
Date Sat, 09 Nov 2013 15:19:13 GMT
HierarchicalFaceting documentation does not clearly explain how to index and query field types
"descendent_path and ancestor_path” included in schema.xml. 

Any help would be greatly appreciated.


    <!-- 
      Example of using PathHierarchyTokenizerFactory at index time, so
      queries for paths match documents at that path, or in descendent paths
    —>

    <fieldType name="descendent_path" class="solr.TextField">
      <analyzer type="index">
	<tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
      </analyzer>
      <analyzer type="query">
	<tokenizer class="solr.KeywordTokenizerFactory" />
      </analyzer>
    </fieldType>

    <!-- 
      Example of using PathHierarchyTokenizerFactory at query time, so
      queries for paths match documents at that path, or in ancestor paths
    —>

    <fieldType name="ancestor_path" class="solr.TextField">
      <analyzer type="index">
	<tokenizer class="solr.KeywordTokenizerFactory" />
      </analyzer>
      <analyzer type="query">
	<tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
      </analyzer>
    </fieldType>


On Nov 9, 2013, at 15:22, Upayavira <uv@odoko.co.uk> wrote:

> http://wiki.apache.org/solr/HierarchicalFaceting
> 
> Upayavira
> 
> On Sat, Nov 9, 2013, at 12:09 PM, Nea wrote:
>> Hi Everybody,
>> 
>> I’m using Solr 4.5.1 and I need to achieve a HierarchicalFaceting for
>> leveled categories. Someone can explain me how schema.xml and query
>> should be?
>> 
>> 
>> My category path is;
>> 
>> Cameras > Camcorders                                                    [
>> 5 items]
>> Cameras > Digital Cameras
>> Cameras > Digital Cameras > Digital SLR                 [15 items]
>> Cameras > Digital Cameras > Mirrorless Cameras          [  4 items]
>> 
>> 
>> And i want to facet as;
>> 
>> first query:
>> 	cameras	(24)
>> 
>> second level query
>> 	camorders (5)
>> 	digital cameras (19)
>> 
>> third level facet query for digital cameras
>> 	digital slr (15)
>> 	mirrorless (4)
>> 
>> 
>> ty.
>> 
>> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message