Let's say I've data in this format:
{
"id": "doc0",
"tags": ["a", "b", "c"]
}
{
"id": "doc1",
"tags": ["a", "b", "c", "d"]
}
{
"id": "doc2",
"tags": ["a", "b"]
}
I need to form an ES query that fetches only documents that contains both "a", "b" and nothing else.
If I write a terms query, it matches all the documents, as all documents have both "a" and "b" but only one document has nothing else apart from "a" and "b"
What is the best way to form this query? I don't have the list of the other values to add "not_contains" clause.