Reputation: 11
In Elasticsearch 7.16, for some date fields the Min/Max aggregation returned a value as 'format_specifiedin*_*the_aggregation'+'epochtimeinmillis', however for some other date fields it is returning the expected value for value_as_string.
The two fields : serviceDate and udf41
Mappings:
"serviceDate": {
"type": "date",
"format": "epoch_millis || yyyy-MM-dd HH:mm:ss || yyyy-MM-dd"
},
"udf41": {
"type": "date",
"format": "epoch_millis || yyyy-MM-dd HH:mm:ss || yyyy-MM-dd"
}
Aggregations:
"aggregations": {
"udf41_max": {
"max": {
"field": "udf41",
"format": "yyyy-MM-dd"
}
},
"serviceDate": {
"max": {
"field": "serviceDate",
"format": "yyyy-MM-dd"
}
}
}
Response:
"aggregations": {
"serviceDate": {
"value": 1.6927488E12,
"value_as_string": "2023-08-23"
},
"udf41_max": {
"value": 1.6828128E12,
"value_as_string": "yyyy-MM-dd1682812800000"
}
}
Both fields have the same mappings, and even when I attempted to send a different format in the aggregation, the same scenario replicated.
What might be the cause of this?
Upvotes: 0
Views: 118