How to search in an array passing multiple values

I have filed with multiple values,


{ "applids": [
                       "6512708",
                       " 8234215"
                   ] } 


how to pass multiple values and search ?

You search arrays in the same way as any other field. Issuing a Match or Term query on field "applids" for "6512708" should return the same result as if the field was a string e.g. "applids": "6512708".

A Terms query will do multiple values at once, e.g. "give me 6512708 or 8234215". I'd recommend making this field a Keyword field in your mappings if you're only going to do exact matches on it.

it worked after making the field type long. thank you

1 Like