Sorry, I think I must be misunderstanding something, if I do:

GET /summary/row/_search
{
  "query": {
    "match": {
      "field3": 1
    }
  },
  "aggs": {
    "terms": {
      "field": "field1"
    },
    "field1_count": {
      "sum": {
        "field": "count"
      }
    }
  }
}

I just get this in the response:

"aggregations": {
      "file1_count": {
         "value": 75000
      }
   }

It's just ignoring all the values of 'file1' and adding all the sizes from 
the response. Am I doing something wrong?

Thanks,
Jose.

On Friday, 2 May 2014 15:55:50 UTC+1, Adrien Grand wrote:
>
> On Fri, May 2, 2014 at 4:47 PM, Jose A. Garcia 
> <[email protected]<javascript:>
> > wrote:
>
>> That's closer but I would get all the possible values and counts for 
>> 'fieldA' and the total sum of 'size' for my result set, but I need the sum 
>> of sizes for each value of 'fieldA', so it's a combination of both terms 
>> and sum, but none seems to give me exactly what I need...
>>
>
> This should work: The sum aggregation is _under_ the terms aggregation, so 
> sums would be computed for each unique value of 'fieldA'.
>
> -- 
> Adrien Grand
>  

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/3e7e30bd-2482-4c99-9643-679adef5610d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to