Hi, Is it possible to sort search results based on the count of similar documents a document has? Say we have a document A which has 4 other similar documents in the index and document B which has 10. Then the order solr returns them should be B, A. Sorting on moreLikeThis counts for each document would be an example of this (in my case I use ngram similarity detection from Tika).
I have tried doing this via custom SearchComponent, where I can find all similar documents for each document in current search result, then add a new field into document hoping to use sort parameter (q=*&sort=similarityCount). But this will not work because sort is done before handling my custom search component, if added via last-components. Can't add it via first-components, because then I will have no access to query results. And I do not want to override QueryComponent because I need to have all the functionality it covers: grouping, facets, etc. Thanks