lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abhijit Deka <abhijit.d...@rocketmail.com>
Subject SUM in result grouping
Date Tue, 26 May 2015 05:40:19 GMT
Is it possible to SUM in a Group query?I am using the Solr group function and it's retrieving
the results.Now, I want to SUM the numeric field.Is it possible.

My query is like this-http://localhost:8983/solr/glaas/select?%20q=abc%20&fl=TotalInvoices%20&wt=json%20&indent=true%20&debugQuery=true%20&group=true%20&group.field=vendor&group.limit=100

My output is like this-{    "groupvalue":"abc",
    "doclist":{"numfound":3,"start":0,"docs":[          {            "TotalInvoices":100;
      },    
     {            "TotalInvoices":200;
      },     {            "TotalInvoices":50;
      }, ]
 }}
I want to SUM the TotalInvoices in the result set. 
Something like 
      {            "TotalInvoices":350;//Sum of all the returned set.
      },
Is it possible in Solr?Please help.

Regards
Abhijit DekaComputer ScientistAdobe SystemsBangalore
Ph-+91 80884 39067
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message