I have a requirement where I want to delete the documents which match the query but only if they are in the read index , if it is in a write index I don't want the documents to be deleted.
Below query deletes irrespective of whether read or write index.
Iam using the delete by query api
Post /(alias name)/_delete_by_query
{
"query": {
"term": {
"id":"101"
}
},
"max_docs": 1,
"sort": [
{
"dateField": {
"order": "asc"
}
}
]
}.
Can you please tel me know if the query can be changed in a way it deletes only from read index.
Thank you