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 "Mike L." <ja...@yahoo.com.INVALID> on 2015/07/06 19:33:35 UTC

Category Hierarchy on Dynamic Fields - Solr 4.10

Solr User Group -
    Was wondering if anybody had any suggestions/best practices around a requirement for storing a dynamic category structure that needs to have the ability to facet on and maintain its hierarchy
Some context:

A product could belong to an undetermined amount of product categories that contain a logical hierarchy. In other-wards, depending on a vendor being used, each product could contain anywhere from 1-N levels deep of product categories. These categories do have a hierarchy that would need to be maintained such that the website could drill down those category facets to find the appropriate product.

Examples:Product A is associated to : Category , Subcategory 1, Subcategory 2, Subcategory 3, Subcategory 4
Product B is associated to: Category , subcategory 1, Subcategory 2Product C is associated to: Category, subcategory 1etc.
If the category structure was a bit more predictable, it would be easy to load the data into Solr and understand from a UI perspective how best to create a faceted hierarchy. 

However, because this category structure is dynamic and different for each product, I'm trying to plan for the best course of action in terms of how to manage this data into Solr and be able to provide category facets and guide the UI to how best to query the data in the appropriate hierarchy.
I'm thinking of loading the category structure using dynamic fields, but any good approaches on how best to facet and derive a hierarchy on those dynamic fields? Or other thoughts around this.

Hope that makes sense.
Thanks,

Re: Category Hierarchy on Dynamic Fields - Solr 4.10

Posted by "Mike L." <ja...@yahoo.com.INVALID>.
Hey Erick,
Thanks for the response. I haven't used PathHierarchyTokenizerFactory before...
Seems with this approach, I'd flatten all the categories pertaining to a product into one Solr field... I guess using the facet.prefix I wont lose the granularity I need to facet on individual categories and can maintain the hierarchy..
I'll take a look at it.
Thanks!

       From: Erick Erickson <er...@gmail.com>
 To: solr-user@lucene.apache.org; Mike L. <ja...@yahoo.com> 
 Sent: Monday, July 6, 2015 12:42 PM
 Subject: Re: Category Hierarchy on Dynamic Fields - Solr 4.10
   
Hmmm, probably missing something here, but have you looked at
PathHierarchyTokenizerFactory?

In essence, it indexes each sub-path as a token, which makes lots
of faceting tasks easier. I.e.
lev1/lev2/lev3
gets tokenized as three tokens
lev1/lev2/lev3
lev1/lev2
lev1

If that works, I'm not quite sure why you need dynamic fields here, but
then I only skimmed.

Best,
Erick



On Mon, Jul 6, 2015 at 10:33 AM, Mike L. <ja...@yahoo.com.invalid> wrote:
>
> Solr User Group -
>    Was wondering if anybody had any suggestions/best practices around a requirement for storing a dynamic category structure that needs to have the ability to facet on and maintain its hierarchy
> Some context:
>
> A product could belong to an undetermined amount of product categories that contain a logical hierarchy. In other-wards, depending on a vendor being used, each product could contain anywhere from 1-N levels deep of product categories. These categories do have a hierarchy that would need to be maintained such that the website could drill down those category facets to find the appropriate product.
>
> Examples:Product A is associated to : Category , Subcategory 1, Subcategory 2, Subcategory 3, Subcategory 4
> Product B is associated to: Category , subcategory 1, Subcategory 2Product C is associated to: Category, subcategory 1etc.
> If the category structure was a bit more predictable, it would be easy to load the data into Solr and understand from a UI perspective how best to create a faceted hierarchy.
>
> However, because this category structure is dynamic and different for each product, I'm trying to plan for the best course of action in terms of how to manage this data into Solr and be able to provide category facets and guide the UI to how best to query the data in the appropriate hierarchy.
> I'm thinking of loading the category structure using dynamic fields, but any good approaches on how best to facet and derive a hierarchy on those dynamic fields? Or other thoughts around this.
>
> Hope that makes sense.
> Thanks,

  

Re: Category Hierarchy on Dynamic Fields - Solr 4.10

Posted by Erick Erickson <er...@gmail.com>.
Hmmm, probably missing something here, but have you looked at
PathHierarchyTokenizerFactory?

In essence, it indexes each sub-path as a token, which makes lots
of faceting tasks easier. I.e.
lev1/lev2/lev3
gets tokenized as three tokens
lev1/lev2/lev3
lev1/lev2
lev1

If that works, I'm not quite sure why you need dynamic fields here, but
then I only skimmed.

Best,
Erick

On Mon, Jul 6, 2015 at 10:33 AM, Mike L. <ja...@yahoo.com.invalid> wrote:
>
> Solr User Group -
>     Was wondering if anybody had any suggestions/best practices around a requirement for storing a dynamic category structure that needs to have the ability to facet on and maintain its hierarchy
> Some context:
>
> A product could belong to an undetermined amount of product categories that contain a logical hierarchy. In other-wards, depending on a vendor being used, each product could contain anywhere from 1-N levels deep of product categories. These categories do have a hierarchy that would need to be maintained such that the website could drill down those category facets to find the appropriate product.
>
> Examples:Product A is associated to : Category , Subcategory 1, Subcategory 2, Subcategory 3, Subcategory 4
> Product B is associated to: Category , subcategory 1, Subcategory 2Product C is associated to: Category, subcategory 1etc.
> If the category structure was a bit more predictable, it would be easy to load the data into Solr and understand from a UI perspective how best to create a faceted hierarchy.
>
> However, because this category structure is dynamic and different for each product, I'm trying to plan for the best course of action in terms of how to manage this data into Solr and be able to provide category facets and guide the UI to how best to query the data in the appropriate hierarchy.
> I'm thinking of loading the category structure using dynamic fields, but any good approaches on how best to facet and derive a hierarchy on those dynamic fields? Or other thoughts around this.
>
> Hope that makes sense.
> Thanks,