Hi all, I have a question regarding a query I am attempting to do.
Lets say we have a document:
{
"array": ["value1", "value2", "value3"]
}
And I have two queries:
Query 1:
"array": ["value1", "value2", "value3", "value4"]
Query 2:
"array": ["value1", "value3", "value4"]
The document should be returned for Query 1, but should not for Query 2 as the query does not contain all the elements in the document.
How do you guys suggest going about solving this issue? My two solutions are currently:
- Create a script that returns
true
orfalse
based on if each element from the document is in the query. - use the terms set query but this would require I change my mappings which I would like to avoid.
Any advice would be appreciated!