Hi Have you investigated JSON Facets, they can be sorted by a function, perhaps that helps solve your use case?
https://lucene.apache.org/solr/guide/7_3/json-facet-api.html#FacetSorting <https://lucene.apache.org/solr/guide/7_3/json-facet-api.html#FacetSorting> -- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com > 19. jul. 2018 kl. 00:05 skrev Satheesh Akkinepally > <satheesh.akkinepa...@gmail.com>: > > I posted this in solr-user group but perhaps, this is the right group to ask > questions on internals of solr? > > Hello all, > If I want to plug in my own sorting for facets, what would be the best > approach. I know, out of the box, solr supports sort by facet count and sort > by alpha. I want to plug in my own sorting (say by relevancy). Is there a way > to do that? Where should I start with if I need to write a Custom Facet > Component? > Basically I want to plug the scores calculated in earlier steps for the > documents matched, do some kind of aggregation of the scores of the documents > that fall under a facet and use this aggregate score to rank the facets than > doing the facet ranking based on counts. I am assuming this is something > possible. Just looking for some guidance as to where to start with > > Appreciate the responses from the community > > Thanks >