user3240544
user3240544

Reputation: 267

Hybris Facet Navigation

Does anyone have an idea how to add additional attributes in my Facet Navigation which is displayed on the product list page? So far I can choose only price ranges, but I want to add brands and other filters, do you know how to maintain it via the hMC? I think it has something to do with the solr configurations, but I'm fairly new to hybris...

Upvotes: 3

Views: 10560

Answers (5)

Barath
Barath

Reputation: 13

If you have hybris wiki access then you can easily finish this. In commerce trails they have covered about facet search. Kindly have a look at it. https://wiki.hybris.com/display/R5T/Tweaking+SolR+Attributes+and+Facets

Upvotes: 0

Mouad EL Fakir
Mouad EL Fakir

Reputation: 3759

Unfortunately you can't just simply add your new solrIndexedProperty to solrIndexedType via HMC and hope it will work, it wont work, because you have to maintain some other points:

  1. If your new attribute is a complex object for example (Brand, Price, Unite,...) you have to create a Value Provider to transform that object to a simple primitive data (string, int, double,...) and send it to solr to be indexed, for example, Brand to Brand.name and Price to Price.formattedValue...
  2. Then you have to expose your new solrIndexedProperty value to the front side via FacetPopulator.

Upvotes: 0

Ishwar
Ishwar

Reputation: 117

For adding more product attributes like brand, name, any_other_attribute, you should go to:

HMC>System>Facet Search>Indexed Type

. search with blank field.

Now choose <Index TYPE> like **product. Now you can see all product attributes in a table. And there are some checkboxes around them.

These are search setting for attributes inside the product.

Upvotes: 1

Benoit Vanalderweireldt
Benoit Vanalderweireldt

Reputation: 2989

Best way is to have a look at what is provided out of the box, under for example the electronic store, open the file /electronicsstore/resources/electronicsstore/import/sampledata/stores/electronics/solr.impex

Inside you will find facets definition, for example this is a facet definition for Megapixles :

INSERT_UPDATE SolrIndexedProperty;solrIndexedType(identifier) unique=true];name[unique=true];type(code);sortableType(code);currency[default=false];localized[default=false];multiValue[default=false];facet[default=false];facetType(code);facetSort(code);priority;visible;fieldValueProvider;customFacetSortProvider;rangeSets(name);$classAttributeAssignment
;electronicsProductType;Megapixel, 63          ;double;; ;    ; ;true;MultiSelectOr;Custom;1000;true;commerceClassificationPropertyValueProvider;numericFacetSortProviderDesc;MegaPixelRange;57:::Megapixel, 63::::

What you need to remember is that for any customized types other that literal/Atomic you would need to create your own provider. For every basic Literal/Atomic type (String,double,integer,boolean) the commerceClassificationPropertyValueProvider would be enough.

Upvotes: 5

Manohar Ch
Manohar Ch

Reputation: 465

There are two ways to do this
1.Impex: Go to solr.impex file and add the facet(=true) property to SolrIndexedProperty type header
Ex: INSERT_UPDATE SolrIndexedProperty;solrIndexedType(identifier)[unique=true];name[unique=true];type(code);sortableType(code);currency[default=false];localized[default=false];multiValue[default=false];facet[default=false];facetType(code);facetSort(code);priority;visible;fieldValueProvider;customFacetSortProvider;rangeSets(name);$classAttributeAssignment
;electronicsProductType;Megapixel, 63 ;double;; ; ; ;true;MultiSelectOr;Custom;1000;true;commerceClassificationPropertyValueProvider;numericFacetSortProviderDesc;MegaPixelRange;57:::Megapixel, 63::::


2.hmc: hmc --> System --> Facet Search --> SolrItemType --> select solritemtype --> add solrindexproperties --> select facet checkbox to true

Upvotes: 1

Related Questions