Fix sort on date fields with missing values (#73763)#116099
Open
hanjongho wants to merge 9 commits intoelastic:mainfrom
Open
Fix sort on date fields with missing values (#73763)#116099hanjongho wants to merge 9 commits intoelastic:mainfrom
hanjongho wants to merge 9 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/es-search (Team:Search) |
Collaborator
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
Author
|
hi @drempapis @smalyshev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hi @cbuescher, @jimczi
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)indatefield (doc does not have a date field),sort value return
-9223372036854775808Lby the following logiccan simulate this case with this order
1. Put Index Settings
2. Bulk 2 documents that has
date_nanos,datetype each3. Query with
.missing("_last").sort(SortOrder.DESC)indate_nanosfield3.1 Actual Result
this works well, fixed in #74760
4. Query with
.missing("_last").sort(SortOrder.DESC)indatefield4.1 Actual Result
Suggest
when I searched for the issues related to this error, I found #73763, which is the same issue about

date_nanos.I checked the PR #74760 (commited by @cbuescher) for the issue. when I added the
datetype to the logic (PR) and tested it in my local,0Lresponded well normally. and when I tested it with order asc, neededLong.MAX_VALUE, elastic search's specification.please understand if there is something wrong in my explanation. review it when you have time.
thank you 👍