partial implementation of the grouping/collapsing for Solr