cancel
Showing results for 
Search instead for 
Did you mean: 

how to create a solr facet sort for months jan to dec

Former Member
0 Kudos

Hi All, I am new to hybris, there is a requirement to sort in the solr facet Ex: Daily,Eeekly Monthly and Yearly like this instead of ascending or descending. Please help me to complete this implementation

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Follow this code. In fitAttributeComparator put ur values. put this fitAttributeSortProvider in solr impex as customSortProvider.

 <bean id="fitAttributeSortProvider" class="de.hybris.platform.solrfacetsearch.config.impl.DefaultFacetSortProvider">
         <property name="comparator" ref="fitFacetAttributeComparator"/>
 </bean>
 
 <bean id="fitFacetAttributeComparator" class="de.hybris.platform.acceleratorservices.search.comparators.FacetValueNameComparator">
         <property name="comparator" ref="fitAttributeComparator"/>
 </bean>
 
 <bean id="fitAttributeComparator"
           class="de.hybris.platform.acceleratorservices.search.comparators.SizeAttributeComparator">
     <property name="pattern" value="[0-9]+(\.[0-9])*"/>
     <property name="sizeSystems">
         <list>
             <value>Small</value>
             <value>Small_Medium</value>
             <value>Medium</value>
             <value>Medium_Large</value>
             <value>Large</value>
         </list>
     </property>
 </bean>