Hi
I have found some inconsistency about querying non-exist fields
for most of the cases , exception will be thrown only in nested range aggregation,
If I query non-exist fields in query context or other types of aggregation, there is no exception and only return empty results
For example
GET /index_name/_search
{
"from":0,
"size": 0,
"query": {
"nested": {
"path": "test",
"query": {
"match": {
"index_type": "testA"
}
}
}
},
"aggs": {
"test": {
"nested": {
"path": "mypath"
},
"aggs": {
"test1": {
"range": {
"field": "non-existing field",
"ranges": [
{
"from": "2024-01-01"
}
]
}
}
}
}
}
}
there will be error below
{
"error": {
"root_cause": [
{
"type": "number_format_exception",
"reason": "For input string: "2024-01-01""
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,