I am having the same issue as https://discuss.elastic.co/t/granted-documents-query-with-filter-by-timestamp/201834 and https://discuss.elastic.co/t/document-level-security-combining-queries-together/136143
{
"bool": {
"must": [
{
"terms": {
"name": [
"John"
]
}
},
{
"range": {
"birthdate": {
"gte": "now-30y"
}
}
}
]
}
}
I am getting the following error message when I try to search the index with a user linked to the Role:
Request failed to execute. Call: Status code 400 from: POST /users/_search?typed_keys=true. ServerError: Type: search_phase_execution_exception Reason: "all shards failed" CausedBy: "Type: parse_exception Reason: "could not read the current timestamp" CausedBy: "Type: illegal_argument_exception Reason: "'now' is not allowed in DLS queries"""
I am not sure why because now is perfectly parsed in DSL queries in Kibana Discovery for example. Do you have any idea on how to create a document-level security role with a relative date to now?
Thanks.