I'm trying to find the min date on documents of an index.
All works good if i'm trying to do it on a specific index, such as:
GET index1/_search
{
"size": 0,
"aggs": {
"min_date": {
"min": {
"field": "date_of_birth"
}
}
}
}
The results is good, and i'm getting the value as string:
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 545,
"max_score": 0,
"hits": []
},
"aggregations": {
"min_date": {
"value": -155865600000,
"value_as_string": "23/01/1965"
}
}
}
but when i'm adding the search on index2 also, which doesn't have this field:
GET index1,index2/_search
{
"size": 0,
"aggs": {
"min_date": {
"min": {
"field": "date_of_birth"
}
}
}
}
The result is in milis only (in the code, i see that the formatter is Raw and not DateTime):
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 10,
"successful": 10,
"failed": 0
},
"hits": {
"total": 1069,
"max_score": 0,
"hits": []
},
"aggregations": {
"min_date": {
"value": -155865600000
}
}
}
Is there a way to solve this?