-
Notifications
You must be signed in to change notification settings - Fork 25.2k
range query on dates can see small numbers of millis as a year #63680
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
Comments
Pinging @elastic/es-search (:Search/Search) |
I think we should force parsing with "epoch_millis" when the argument of to or from is a number. Working on a fix. |
I think maybe this an 8.0 breaking change kind of thing though. |
For the record: numeric values smaller than 1000 are currently interpreted as is by "strict_date_optional_time||epoch_millis" (meaning they stay as they are), four digit numbers like 1000, 1555, 1968 are converte to milliseconds since epoch (negative and positive after 1970) and five digit numbers are again interpreted as is (e.g. 10000 stays like that, meaning 10000ms since 1970). This is truly odd and we certainly improve the situation by always parse ints with "epoch_millis" here. |
Currently, if you write a date range query with numeric 'to' or 'from' bounds, they can be interpreted as years if no format is provided. We use "strict_date_optional_time||epoch_millis" in this case that can interpret inputs like 1000 as the year 1000 for example. We should change this to always interpret and parse numbers in this case with the second option "epoch_millis" if no other formatter was provided. Closes elastic#63680
Currently, if you write a date range query with numeric 'to' or 'from' bounds, they can be interpreted as years if no format is provided. We use "strict_date_optional_time||epoch_millis" in this case that can interpret inputs like 1000 as the year 1000 for example. This PR change this to always interpret and parse numbers with the "epoch_millis" parser if no other formatter was provided. Closes #63680
If you write a date range query with numeric parameters we can interpret them as a year. Check it out:
The
1000
gets turned into a String internally and then we parse it as the year 1000.The text was updated successfully, but these errors were encountered: