Currently, the solr group ( http://wiki.apache.org/solr/FieldCollapsing ) sorts the groups "according to the count of the top document within each group . " For instance.
[...] "groups":[{ "groupValue":"81cb63020d0339adb019a924b2a9e0c2", "doclist":{"numFound":9,"start":0,"maxScore":4.729042,"docs":[ { "id":"7481df771afe39fab368ce19dfeeb528", [...], "score":4.729042}, { "id":"c879e95b5f16343dad8b1248133727c2", [...], "score":4.6635237}, { "id":"485b9aec90fd3ef381f013c51ab6a4df", [...], "score":4.347174}] }}, [...]
Is there a ready-made way to sort groups by the sum of the document ratings within each group? For instance.
[...] "groups":[{ "groupValue":"81cb63020d0339adb019a924b2a9e0c2", "doclist":{"numFound":9,"start":0,"scoreSum":13.739738,"docs":[ { "id":"7481df771afe39fab368ce19dfeeb528", [...], "score":4.729042}, { "id":"c879e95b5f16343dad8b1248133727c2", [...], "score":4.6635237}, { "id":"485b9aec90fd3ef381f013c51ab6a4df", [...], "score":4.347174}] }}, [...]
With the release of sorting by Query function ( https://issues.apache.org/jira/browse/SOLR-1297 ) it seems like there should be a way to use the sum () function ( http://wiki.apache.org/solr/FunctionQuery ) But this is not quite close enough, since the "evaluation" field is not part of the documents.
I feel like I'm near, but I miss some obvious part. I am using Solr 3.5.