You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sorting by a date field, if the field is not present on a record and "missing": "_first", "order": "asc" is specified (probably also applies to opposite) in the sort array, the returned sort array returns -9223372036854775808 for the sort value. If that value is passed back into the search_after array (for the next query) as a string, an error is returned: "failed to parse date field [-9223372036854775808] with format [strict_date_optional_time||epoch_millis]"
If it is passed as a number, it works fine.
If any other valid long value is passed as a string, it works fine.
Since Long.MIN_VALUE = -Long.MAX_VALUE - 1 and Long.MIN_VALUE = -9223372036854775808 I expect that this is an unhandled edge case.
Related component
Search:Resiliency
To Reproduce
Open the Dev Tools in the Dashboard
Run a query which sorts on a date field and put "-9223372036854775808" in the search_after field
Result is error
Note: it may be required to have actual records which are missing the date field and you may need to have an ID field so the sort works correctly.
Host/Environment (please complete the following information):
Version: OpenSearch 2.15
Additional context
Full exception:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "failed to parse date field [-9223372036854775808] with format [strict_date_optional_time||epoch_millis]: [failed to parse date field [-9223372036854775808] with format [strict_date_optional_time||epoch_millis]]"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "can_match",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "<Index-Removed>",
"node": "<Node Removed>",
"reason": {
"type": "parse_exception",
"reason": "failed to parse date field [-9223372036854775808] with format [strict_date_optional_time||epoch_millis]: [failed to parse date field [-9223372036854775808] with format [strict_date_optional_time||epoch_millis]]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "failed to parse date field [-9223372036854775808] with format [strict_date_optional_time||epoch_millis]",
"caused_by": {
"type": "date_time_parse_exception",
"reason": "date_time_parse_exception: Failed to parse with all enclosed parsers"
}
}
}
}
]
},
"status": 400
}
The text was updated successfully, but these errors were encountered:
Describe the bug
When sorting by a date field, if the field is not present on a record and "missing": "_first", "order": "asc" is specified (probably also applies to opposite) in the sort array, the returned sort array returns -9223372036854775808 for the sort value. If that value is passed back into the search_after array (for the next query) as a string, an error is returned: "failed to parse date field [-9223372036854775808] with format [strict_date_optional_time||epoch_millis]"
If it is passed as a number, it works fine.
If any other valid long value is passed as a string, it works fine.
Since
Long.MIN_VALUE = -Long.MAX_VALUE - 1
andLong.MIN_VALUE = -9223372036854775808
I expect that this is an unhandled edge case.Related component
Search:Resiliency
To Reproduce
"-9223372036854775808"
in the search_after fieldNote: it may be required to have actual records which are missing the date field and you may need to have an ID field so the sort works correctly.
Sample query:
Expected behavior
Query returns next set of results (no exception).
Additional Details
Plugins
None
Screenshots
Host/Environment (please complete the following information):
Additional context
Full exception:
The text was updated successfully, but these errors were encountered: