To save space I want to convert one field to boolean type.
The mapping of the index is-
{
"siddharth-03": {
"mappings": {
"_doc": {
"properties": {
"age": {
"type": "boolean"
}
}
}
}
}
}
I can write a query on elasticsearch to give me the addition of this boolean field in its bucket.
GET siddharth-03/_search
{
"aggs": {
"NAME": {
"sum": {
"field": "age"
}
}
}
}
This results in the correct aggregation value-
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 1,
"hits": [
{
"_index": "siddharth-03",
"_type": "_doc",
"_id": "2",
"_score": 1,
"_source": {
"age": "true"
}
},
{
"_index": "siddharth-03",
"_type": "_doc",
"_id": "1",
"_score": 1,
"_source": {
"age": "true"
}
},
{
"_index": "siddharth-03",
"_type": "_doc",
"_id": "3",
"_score": 1,
"_source": {
"age": "false"
}
}
]
},
"aggregations": {
"NAME": {
"value": 2,
"value_as_string": "true"
}
}
}
When I want to add an aggregation on this boolean field in kibana, it shows me that the boolean field is not a compatible field for aggregations. How can I sum over this field in kibana?