Reputation: 1
I have created this query to search for documents where empId is "XXXXXX" and joiningDate is before now (today's date).
GET employees/_search
{
"query": {
"bool": {
"filter": [
{
"term": {
"empId": "XXXXXX"
}
},
{
"range": {
"joiningDate": {
"lte": "now"
}
}
}
]
}
}
}
I want help in modifying it to have the joiningDate condition as below joiningDate is before now-10 days (today's date-10 days)
Upvotes: 0
Views: 37
Reputation: 225
{
"query":{
"bool":{
"filter":[
{
"term":{
"empId":"XXXXXX"
}
},
{
"range":{
"joiningDate":{
"gte":"now-10d/d",
"lt":"now/d"
}
}
}
]
}
}
}
Upvotes: 1