-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] Sorting on a field of type basic_date_time_no_millis gives a java.time.DateTimeException #11138
Comments
fyi
|
also, if we set size=3
Note: if we sort by integer field and a doc have no value, we got -Int.MAX_VALUE.
Assuming that handling absent integers is correct, how to handle formatting -Long.MAX_VALUE into date? Should we cap years to -9999? |
when sorting by date column, missing values transferred as Long.MIN/MAX_VAL see IndexFieldData.XFieldComparatorSource.missingObject() When this value formatted for merging in coordinator it hit the error.
Sharing some observations: I need a suggestion to continue work on this. see https://opensearch.org/docs/latest/field-types/supported-field-types/date/#built-in-formats |
This interesting, we have a change merged recently #11196 related to |
@reta, I suppose #11196 test would fail if we add dates with some basic_* format there. |
@gashutos Could you take a stab and share your thoughts on this? |
This should get fixed with above PR. @mkhludnev if you get chance to test this on latest version. |
You already tested, cool let me see what more is required there. |
@gashutos closing this out as based on search community meeting discussion. Feel free to re-open if you find anything more on this |
Describe the bug
Background:
Problem: when sorted by this field with
size = <number of search results>
, OpenSearch returns a Java exception. Full queries are laid out in section "To Reproduce".To Reproduce
Create an index without a date field.
PUT {{host}}/{{index}}
Index some documents. One with the date value, another without.
POST {{host}}/_bulk
Search query "Q1":
The query fails with
size
set to2
(the number of documents in the index). Values1
and3
forsize
work. Addingmissing=0
seems to be a workaround.Expected behavior
Query "Q1" (above) should return result:
Plugins
None.
Screenshots
Host/Environment (please complete the following information):
Additional context
Tried and reproduced on OpenSearch 2.5.0 and 2.11.0.
This has been reported for ElasticSearch also: elastic/elasticsearch#81960
The text was updated successfully, but these errors were encountered: