I need to return results that do not include docs with certain ids. Elasticsearch allows us to specify which ids are allowed but I see no way to disallow certain ids. In my
You can achieve this by adding a bool/must_not
filter containing an ids
filter with an array of ids you don't want to appear, like this:
{
"query": {
"bool": {
"must": [
... <--- your other filters go here
],
"must_not": [
{
"ids": {
"values": [
"id1", "id2" <--- add all the ids you DON'T want in here
]
}
}
]
}
}
}