0
votes

Hybris 6.5 version

I want to exclude solr facet search results in hybris, I have hidden required facet to exclude the result in facetsearchquerypopulator.java like following code:

for(FacetField facet : facetList) {
  if("price".equals(facet.getField()) && isHidePrices()){
    continue;
  }

  FacetInfo facetInfo = new FacetInfo(facet.getField(), facet.getFacetType());
  facets.put(facet.getField(), facetInfo);

But it didn't work.

1
I don't understand the question. What are you trying to achieve? Don't display products that belong to a special facet? Why index them in the first place?Johannes Nolte

1 Answers

0
votes

Try overriding buildFacets method of SearchResponseFacetsPopulator

    for (final Facet facet : solrSearchResultFacets)
    { 
         if("price".equals(facet.getName()) && isHidePrices()){
          continue;
          }

          ...
          ...
     }