I am not sure if this question is already asked, I tried to search and couldn't find what I was looking for.
I am using routing to reduce my search impact. I am providing routing IDs while indexing (e.g. user1, user2, user3....).
So if I want to search documents I can search it as:
GET my_index/_search?routing=user1,user2
{
"query": {
"match": {
"title": "document"
}
}
}
Now my questions are:
- how can I search on all routing IDs except specific set of routing IDs? (e.g. I want to search on all IDs except user1, user2 and user3) ?
- If I use _routing field in the query will it use routing at all?
GET my_index/_search
{
"query": {
"bool": {
"must_not": [
{
"terms": {
"_routing": [
"user1",
"user2",
"user3"
]
}
}
],
"must": [
{
"match": {
"title": "document"
}
}
]
}
}
}