Hi there.
A friend is having trouble to output the result of a sum aggregation properly.
We tried to format the field in Kibana so the output in the visualization would shown formatted, but it still kept returning oddly formatted.
Here is our test.
PUT /teste_indice_sum_nome
{
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"properties" : {
"testcalc": {
"type": "scaled_float",
"scaling_factor": 100
}
}
}
}
POST teste_indice_sum_nome/_bulk
{ "index" : { "_id" : 1 } }
{ "testcalc" : 0.0 }
{ "index" : { "_id" : 2 } }
{ "testcalc" : 18382.26 }
{ "index" : { "_id" : 3 } }
{ "testcalc" : -808560.25 }
{ "index" : { "_id" : 4 } }
{ "testcalc" : 131606.72 }
{ "index" : { "_id" : 5 } }
{ "testcalc" : 5576474.22 }
{ "index" : { "_id" : 6 } }
{ "testcalc" : -110617.43 }
{ "index" : { "_id" : 7 } }
{ "testcalc" : 14002.85 }
{ "index" : { "_id" : 8 } }
{ "testcalc" : -136577.68 }
{ "index" : { "_id" : 9 } }
{ "testcalc" : 104506.85 }
{ "index" : { "_id" : 10 } }
{ "testcalc" : -4357917.55 }
{ "index" : { "_id" : 11 } }
{ "testcalc" : -431299.99 }
{ "index" : { "_id" : 12 } }
{ "testcalc" : 0 }
GET teste_indice_sum_nome/_search?pretty=true
{
"aggs": {
"TESTANDO": {
"sum": {
"field": "testcalc"
}
}
}
,"size": 0
}