Is there a way to match all values in a document array? for eg. if my search array is ["1","2","3","4","5"]
and my documents have fields like
doc1: "arr":["1","3","5"]
doc2: "arr":["1","2","7","9"]
doc3: "arr":["1","8"]
Then only the first document should be a match because all the values in the document are present in the search array. I tried using the script filter (to get the length of the array) and tried using the minimum_should_match
parameter but I cant get it to work. How do I use a variable created by a script as a parameter for minimum_should_match
?