-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Is your feature request related to a problem? Please describe.
We recently merged #3395 which adds a datetime payload index.
Currently, the datetime parser is very strict, only allowing RFC 3339 formats in our REST API. A common format such as YYYY-MM-DD HH:MM:SS is currently not accepted.
Describe the solution you'd like
We'd like to extend datetime parsing a bit, to accept a bit more predefined formats.
More specifically, we want to support these in our REST API:
- RFC 3339 (already supported)
YYYY-MM-DD'T'HH:MM:SS(without timezone orZ)YYYY-MM-DD HH:MM:SSYYYY-MM-DD HH:MMYYYY-MM-DD
The above list is open for discussion. But as general rule, we want to prevent ambiguity.
There's probably two bits to implement this:
- Accept these formats in the datetime index
- Accept these formats in the
datetime_rangefilter
Describe alternatives you've considered
- Do not support extra formats
We decided to not take this route in an attempt to make the API more lenient. - Support all formats in ElasticSearch
There's a lot of formats, some ambiguous and uncommon, so we decided not to include any others for now. - Support custom formats:
We do not want to implement this right now because it makes the whole API a lot more complex. Maybe in the future.
Additional context
The following query must succeed after implementing the above formats. Currently it fails because the format is not accepted.
POST collections/test_collection/points/scroll
{
"limit": 10,
"filter": {
"must": [
{
"key": "updated",
"range": {
"gt": "2014-01-01T00:00:00"
}
}
]
}
}Related issue: #3531