-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Search/SearchSearch-related issues that do not fall into other categoriesSearch-related issues that do not fall into other categories>bugTeam:SearchMeta label for search teamMeta label for search team
Description
Elasticsearch version: 7.13.1 (newest)
Plugins installed: None
JVM version: ES builtin,
openjdk 16 2021-03-16
OpenJDK Runtime Environment AdoptOpenJDK (build 16+36)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 16+36, mixed mode, sharing)
OS version: Windows 10, 64bit, version 2004, build 19041.985
Steps to reproduce:
POST _bulk
{"index":{"_index":"test","_id":"1"}}
{"field1":"value1", "timestamp": "2021-06-04T13:50:00.000000001"}
{"index":{"_index":"test","_id":"2"}}
{"field1":"value2"}
And the query
GET test/_search
{
"sort": {
"timestamp": {
"order": "desc",
"format": "strict_date_optional_time_nanos",
"numeric_type": "date_nanos"
}
}
}
Expected behaviour
I'd expect both docs to be returned without errors (first doc1, then doc2 with a missing timestamp)
Actual behaviour
{
"error" : {
"root_cause" : [ ],
"type" : "search_phase_execution_exception",
"reason" : "",
"phase" : "fetch",
"grouped" : true,
"failed_shards" : [ ],
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "nanoseconds [-9223372036854775808] are before the epoch in 1970 and cannot be processed in nanosecond resolution"
}
},
"status" : 400
}
Observations
- The error does not occur when sorting ascending, or including
"missing": "_first"in the sort - However, it does occur when sorting ascending and including
"missing": "_first"in the sort - When not specifying a format, no error occurs. However, this is tricky with a search_after (see https://www.elastic.co/guide/en/elasticsearch/reference/7.13/paginate-search-results.html#search-after)
My guess would be that missing values are filled in with a value "before any possible value" (to be first for ascending order, or last in descending order), but that this subsequently fails when showing as a formatted date.
Metadata
Metadata
Assignees
Labels
:Search/SearchSearch-related issues that do not fall into other categoriesSearch-related issues that do not fall into other categories>bugTeam:SearchMeta label for search teamMeta label for search team