Search code examples
solrsap-commerce-cloudsolrj

Hybris SOLR facet indexed property not showing


I've created a new SOLR Indexed property that must act as category a facet:

INSERT_UPDATE SolrIndexedProperty; solrIndexedType(identifier)[unique = true]; name[unique = true]; type(code); multiValue[default = true]; facet[default = true]; facetType(code); facetSort(code); priority; visible; categoryField[default = true]; fieldValueProvider             ; facetDisplayNameProvider         ; topValuesProvider
                             ; $solrIndexedType                          ; color              ; string    ;                           ;                      ; MultiSelectOr  ; Alpha          ; 4000    ; true   ;                              ; colorCategoryNameValueProvider ; categoryFacetDisplayNameProvider ; defaultTopValuesProvider

I've created the custom value provider:

    <bean id="colorCategoryNameValueProvider" parent="abstractCategoryNameValueProvider">
    <property name="categorySource" ref="colorCategorySource" />
</bean>

<bean id="colorCategorySource" parent="abstractCategorySource">
    <property name="rootCategory" value="color" />
</bean>

I've performed a full index and I SOLR Admin I can see the new indexed field populated:

"color_string_mv":["MultiColor",
      "Color"],

However, when I go to PLP/Grid I only see one facet, which is price.

As you can see in the impex, the SolrIndexedPropert isFacet attribute is set to TRUE and is also being populated in SOLR database, why hybris is not detecting this facet and displaying it in the storefront?


Solution

  • The problem was found:

    Along with the SolrIndexedProperty, in order to display the facet I must add the facets attributes as:

    INSERT_UPDATE SolrSearchQueryProperty; indexedProperty(name, solrIndexedType(identifier))[unique = true]; searchQueryTemplate(name, indexedType(identifier))[unique = true][default = DEFAULT:$solrIndexedType]; facet[default = true]; facetType(code); includeInResponse[default = true]; facetDisplayNameProvider             ; facetSortProvider; facetTopValuesProvider
                                     ; categoryPath:$solrIndexedType                                    ;                                                                                                      ;                      ; Refine         ;                                  ;                                      ;
                                     ; category:$solrIndexedType                                        ;                                                                                                      ;                      ; Refine         ;                                  ; categoryFacetDisplayNameProvider ; defaultTopValuesProvider
                                     ; brand:$solrIndexedType                                           ;                                                                                                      ;                      ; MultiSelectOr  ;                                  ; categoryFacetDisplayNameProvider ; defaultTopValuesProvider
                                     ; color:$solrIndexedType                                           ;                                                                                                      ;                      ; MultiSelectOr  ;                                  ; categoryFacetDisplayNameProvider ; defaultTopValuesProvider
                                     ; size:$solrIndexedType                                            ;                                                                                                      ;                      ; MultiSelectOr  ;                                  ; categoryFacetDisplayNameProvider ; defaultTopValuesProvider