0

I made an implementation where I created a custom Facet Value Sort Provider and a custom Facet Top Values provider.

I assigned them to one of my Solr Indexed Properties. I also change the Facet Sort type to Custom

It worked just fine on my local enviroment and in one of our test enviroments as well. But on our QA enviroment only the top values provider is working. The regular Facet Solr Provider applied is based on the facet result count.

I just notice after this implementation that doesn't matter the Facet sort that I select there, it insists to apply the sort by count.

Do you guys have any idea how to make my custom sort work there? Is there maybe a solr xml that I must change?

Facet Settings Tab

Administration tab

Ricardo Machado
  • 784
  • 6
  • 22

2 Answers2

0

After selecting "custom" for SolrIndexedPropertyFacetSort, and setting the field customFacetSortProvider to your custom bean, you need to make sure your bean implements FacetSortProvider and override the comparator method:

@Override
public Comparator<FacetValue> getComparatorForTypeAndProperty(IndexedType arg0, IndexedProperty arg1)
{
    // XXX Auto-generated method stub
    return null;
}
user3271463
  • 11
  • 1
  • 3
  • Hi, it does implements facetSortProvider. Actually I don't have a class for that, just the xml bean configuration extending the DefaultFacetSortProvider. It works on some enviroments so I guess it's more related to some configuration missing somewhere. – Ricardo Machado Jan 10 '20 at 08:13
  • Hello, it might seem silly, but just to make sure, did you run your solr index again after the deployment? Also, try cleaning the platform's cache, just in case. – user3271463 Jan 10 '20 at 10:46
  • Hi, Yes I did run, but on on my local to apply the custom sort provider I don't need to run the index, it work just fine after just changing the sort provider on hmc without executing indexation again. By platform cahce you mean going on /hac on cache tab and cleaning it? If so I did it. Thanks for your inputs. – Ricardo Machado Jan 10 '20 at 10:54
0

It worked after changing the legacyMode to true in SolrSearchConfig. It was the only different between the enviroments

Ricardo Machado
  • 784
  • 6
  • 22