There is someone that could me explain why by this simple aggregation:
> GET cfo1/_search
> {
> "size": 0,
> "aggs": {
> "NAME": {
> "filter": {...},
> "aggs": {
> "somma": {
> "sum": {
> "field": "SommaDiOre_mens_Comm_CdC"
> }
> },
> "aaa": {
> "terms": {
> "field": "SommaDiOre_mens_Comm_CdC",
> "size": 12
> }
> }
> }
> }
> }
> }
I get this response with the sum that is not zero:
> "aggregations" : {
> "NAME" : {
> "doc_count" : 11,
> "aaa" : {
> "doc_count_error_upper_bound" : 0,
> "sum_other_doc_count" : 0,
> "buckets" : [
> {
> "key" : -141.96,
> "doc_count" : 1
> },
> {
> "key" : -41.07,
> "doc_count" : 1
> },
> {
> "key" : -13.6,
> "doc_count" : 1
> },
> {
> "key" : -6.83,
> "doc_count" : 1
> },
> {
> "key" : -6.0,
> "doc_count" : 1
> },
> {
> "key" : 1.44,
> "doc_count" : 1
> },
> {
> "key" : 5.39,
> "doc_count" : 1
> },
> {
> "key" : 6.0,
> "doc_count" : 1
> },
> {
> "key" : 13.6,
> "doc_count" : 1
> },
> {
> "key" : 41.07,
> "doc_count" : 1
> },
> {
> "key" : 141.96,
> "doc_count" : 1
> }
> ]
> },
> "somma" : {
> "value" : 1.5987211554602254E-14