Skip to content
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 dates that are undefinded #28806

Closed
tahergalal opened this issue Feb 23, 2018 · 4 comments
Closed

search_after not working with dates that are undefinded #28806

tahergalal opened this issue Feb 23, 2018 · 4 comments
Labels
feedback_needed :Search/Search Search-related issues that do not fall into other categories

Comments

@tahergalal
Copy link

tahergalal commented Feb 23, 2018

Describe the feature:

Elasticsearch version (6.2.1):

JVM version (java -version):

OS version (windows):

Description of the problem including expected versus actual behavior:
Index with many documents some of which have a value for a date field deletedOn and others don't

query uses a sort : [{"deletedOn": "asc"}, {"_id" : "asc"}]

this sometimes returns a value in the sort:[9223372036854776000,"doc_id_1"] of the hit that when passed to the search if I provide this information to search_after I get an error because the value from thedate field is expected to be a max of an integer with an error No matching token for number_type [BIG_INTEGER]

Steps to reproduce:

  1. create two documents with a date field and a text field
  2. create a document that only has a text field
  3. search for match all size 2 with sort by date field and _id
  4. provide the value obtained to the search_after

Provide logs (if relevant):

@nik9000 nik9000 added :Search/Search Search-related issues that do not fall into other categories >bug labels Feb 23, 2018
@nik9000
Copy link
Member

nik9000 commented Feb 23, 2018

Could someone with @elastic/es-search-aggs take a look, maybe @jimczi?

@jimczi
Copy link
Contributor

jimczi commented Feb 28, 2018

Elasticsearch will never return a value greater than Long.MAX_VALUE (9223372036854775807) for a date field. We use this value by default when a document doesn't have a value for the field that is sort on. What library are you using to parse the json response ? It seems that this library is reading the number returned by es as doubles and not longs. This would explain why 9223372036854775807 is replaced by 9223372036854776000 since doubles cannot accurately represent all numbers.

@tahergalal
Copy link
Author

this is the value I am getting when using the javascript lib. Also when testing the query in kibana I get the same value of 9223372036854776000

@jimczi
Copy link
Contributor

jimczi commented Feb 28, 2018

Ok so this is an issue with javascript that handles number with 64bit floating point and can't represent large number accurately. I am going to close this issue because the problem is not in es. You can check this issue in Kibana: elastic/kibana#1274 and ask there what's the status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback_needed :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

No branches or pull requests

3 participants