0
votes

I have applied solr facet on properties of products.

Eg: The product can be either Medicine(0/1) or Drug(0/1) or Poison(0/1). 0 means NO, 1 means YES.

These are different features of a product hence appear as different facets. It is possible to display them under one facet instead eg: "Type", under which these three solr facet "Medicine", "Drug", "Poison" should display like:

Type
-----
Medicine (50)
Drug (100)
Poison (75)
3
May be create a new product attribute with type ENUM(Medicine,Drug,Poison). after that make this attribute as a facet.sree
Cannot create a new product attribute. I think there is a HierarchicalFaceting in Solr, in which the facet.prefix tag can help me achieve what I'm trying to do. But I'm not sure how to implement this in hybris.Sanchit Khera

3 Answers

0
votes

Not sure about Hybris, but you should be able to do so with facet queries. You would have one facet query per each of your three conditions. In the UI, you can organize the counts anyway you want.

However, I am not sure why you can't just have a category field that contains a multi-valued field that contains Medicine and/or Drug and/or Poison value. Then faceting on that field would give you the breakdowns. If your values do not come in that way, you can probably manipulate them either with copyField or with a custom Update Request Processor chain to merge into one field.

0
votes

This is super easy. Just make an IndexedProperty "Type" and a new custom ValueProvider for it. Then extract these values based on the boolean flags - just hard code if necessary. No need for anything more complex.

0
votes

I tried the solutions posted here but they were not fitting my requirement. I did changes through facet navigation tag files to bring all classification attribute facets (Medicine, Drug, Poison) under a single facet (Type).