Search code examples
javasolrsolrj

Solr stats for each group seperately


I am trying get the specified stat for each grouped data in solr. I managed to grouped the data, but the stats are for the whole data not for each group.

group=true&group.field=potential_campaign_type&group.ngroups=true&group.limit=0&stats=true&stats.field=potential_total_amount

My solr params are like in the above. This returns me the whole stats for data. However, I need the stats for each grouped object. How can I do this?


Solution

  • I was using solr 4.10 version and from the documentations pdf

    documentation

    I found the stats.facet key and it worked. My search params are :

    stats=true&stats.field=potential_total_amount&stats.facet=potential_campaign_type
    

    it returns the stats for the grouped data.