-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort ASC by a field should give those results without that field value #31106
Comments
You have to provide the schema definition, 3 documents and the query and the result you get. |
What is the behaviour if the field is of type long and some docs are missing that field? |
If the field is unset for a document, the sort value for that document will be lower than the value for any other document with a value set. If you need another behaviour you can use a document processor to set a value when it is missing when ingesting data.
|
Correct, if you sort ascending unset document will come first, descending it will come last. |
This is not something that we can change without a major version, and it is not clear what is correct either. |
Or is it ? @bratseth could we change this so sorting on unset values always sorted last, similar to what we do for NaN rank ? |
I would say people shouldn't reasonably depend on this. |
Describe the bug
Currently none of sort ascending and sort descending are giving the right result
To Reproduce
Add doc1 with field f1 as a,
add doc2 with field f1 as b,
add doc3 with field f1 missing
Expected behavior
Ascending should give order
doc3,doc1, doc2
The text was updated successfully, but these errors were encountered: