-
Notifications
You must be signed in to change notification settings - Fork 350
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
feat(es): respect format parameter in range query #5208
feat(es): respect format parameter in range query #5208
Conversation
Thanks for the reply @fulmicoton
|
I suspect you are suffering from a check that verifies that the date format includes parsing times. |
|
@fulmicoton thank you for the response! Examples Successful and Failed Responses ⬇️curl -X GET "http://localhost:7280/api/v1/_elastic/stackoverflow-schemaless/_search?pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"range": {
"age": {
"gte": "2023-01-01",
"lte": "2023-12-31",
"boost": 2.0,
"format": "yyyy-MM-dd"
}
}
}
}
'
{
"status": 400,
"error": {
"caused_by": null,
"reason": "Failed to parse date time: a character literal was not valid",
"stack_trace": null,
"type": null
}
}
curl -X GET "http://localhost:7280/api/v1/_elastic/stackoverflow-schemaless/_search?pretty"
-H 'Content-Type: application/json' -d'
∙ {
∙ "query": {
∙ "range": {
∙ "age": {
∙ "gte": "2023-01-01",
∙ "lte": "2023-12-31",
∙ "boost": 2.0,
∙ "format": "%Y-%m-%d"
∙ }
∙ }
∙ }
∙ }
∙ '
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 0,
"relation": "eq"
},
"hits": []
}
} |
@fulmicoton |
thank you! I will complete our rest api test suite in another PR and send it to you for next time! |
Description
Introduce the support for
format
parameter inRangeQuery
How was this PR tested?
Related issue
#5109