I have a requirement to create a custom Sort Code and add some custom logic(basically no logic – keeping it blank and return 0) to it. I have define the beans for provider and comparator and defined required impex also. But somehow it’s still sorting by ‘relevance‘ and debugger is going to OOTB Comparator (here FacetDisplayNameComparator), instead of the custom comparator I created. Can someone help me understand what I am missing here ?
The beans I defined are:
<bean id="customProvider"
class="de.hybris.platform.solrfacetsearch.config.impl.DefaultFacetSortProvider">
<property name="comparator" ref="customAttributeComparator"/>
</bean>
<bean id="customAttributeComparator" class="de.hybris.platform.acceleratorservices.search.comparators.FacetValueNameComparator">
<property name="comparator" ref="customComparator"/>
</bean>
<bean id="customComparator" class="de.dksh.connect.services.search.comparators.CustomScoreAttributeComparator">
</bean>
and below is the impex I created:
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=true] ; facetType(code) ; facetSort(code) ; priority ; visible ; useForSpellchecking[default=false] ; useForAutocomplete[default=false] ; fieldValueProvider ; facetDisplayNameProvider ; customFacetSortProvider ; topValuesProvider ; rangeSets(name)
; $solrIndexedType ; customAttribute ; double ; ; ; true ; ; ; MultiSelectOr ; Custom ; 2000 ; true ; ; ; ; ; customProvider ;
INSERT_UPDATE SolrSort ; &sortRefID ; indexedType(identifier)[unique=true] ; code[unique=true] ; useBoost
; sortRef5 ; $solrIndexedType ; customAttribute ; false
INSERT_UPDATE SolrSortField ; sort(indexedType(identifier),code)[unique=true] ; fieldName[unique=true] ; ascending[unique=true]
; $solrIndexedType:score ; customAttribute ; false
1