-
Notifications
You must be signed in to change notification settings - Fork 730
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
🐛 search_after not working with undefined fields #662
Comments
Hmm, this is tricky... my thoughts on the issue: If my research is correct JavaScript's
That said, I also kind of hate the way JavaScript handles this too, and I would much prefer a more explicit failure when esjs parses numbers from Elasticsearch that it can't actually represent. I think my preferred corse of action would be:
|
We understand that this might be important for you, but this issue has been automatically marked as stale because it has not had recent activity either from our end or yours. Note: in the past months we have built a new client, that has just landed in master. If you want to open an issue or a pr for the legacy client, you should do that in https://github.com/elastic/elasticsearch-js-legacy |
As clarified here: elastic/elasticsearch#28806 elasticsearch returns
-9223372036854775808
(elasticsearch's max long) as the sort value for documents that are missing the field that they are supposed to sort on. elasticsearch (non-JS) also accepts that number as a validsearch_after
value.JS evaluates
-9223372036854775808
as-9223372036854776000
, which when fed back into search_after fails with an errorNo matching token for number_type [BIG_INTEGER]
.Of course we can't give elasticsearch back
-9223372036854775808
as a number in JS land, but we can give it back a string version of the same, at which point we get expected behaviour. My local fix has been to filter returned sort values as shown below.It seems like a similar fix could be incorporated into the ES-JS codebase in order to isolate consumers from this issue altogether.
thoughts?
The text was updated successfully, but these errors were encountered: