Open hanjongho opened 2 weeks ago
Hello! I would like to work on this issue!
I believe the fix for dates_nanos
was #74760. In that, it is mentioned that:
For missing values on date fields we use Long.MIN_VALUE by default. This is okay when the resolution of the field is milliseconds
I wonder if you can elaborate on the problem you are facing when Long.MIN_VALUE is used as the sort value for millisecond resolution dates?
Pinging @elastic/es-search (Team:Search)
I believe the fix for
dates_nanos
was #74760. In that, it is mentioned that:For missing values on date fields we use Long.MIN_VALUE by default. This is okay when the resolution of the field is milliseconds
I wonder if you can elaborate on the problem you are facing when Long.MIN_VALUE is used as the sort value for millisecond resolution dates?
yes. comment is correct. it says it also include date field, but in the code, it only includes NumericType.DATE_NANOSECONDS
. this is PR that I fixed it includes NumericType.DATE
https://github.com/elastic/elasticsearch/pull/116099
Elasticsearch Version
7.15.2
Installed Plugins
No response
Java Version
bundled
OS Version
centos 7
Problem Description
I'm trying to find and share the error in the logic of sort with missing, order method together in the date field. while using .missing("_last").sort(SortOrder.DESC) or .missing("_front").sort(SortOrder.ASC) in date field (doc does not have a date field) sort value return -9223372036854775808L by the following logic
Steps to Reproduce
can simulate this case with this order
1. Put Index Settings
2. Bulk 2 documents that has
date_nanos
,date
type each3. Query with
.missing("_last").sort(SortOrder.DESC)
indate_nanos
field3.1 Actual Result
this works well, fixed in https://github.com/elastic/elasticsearch/pull/74760
4. Query with
.missing("_last").sort(SortOrder.DESC)
indate
field4.1 Actual Result
Logs (if relevant)
No response
Implement PR (fiexed)
https://github.com/elastic/elasticsearch/pull/116099