Match query on array field

We have a standard match query

{
    "query": {
        "match" : {
            "names" : "John smith"
            "operator": "and"
        }
    }
}

The field names is an array that contains, for a document, values like:

"name": ["J Smith", "John S"]

Our use case is that we
a) want to keep this as an array (we don't know how many names we have)
b) we only want a doc to be a match if an array element (as opposed to the entire array) contains all the words in the search query. (i.e. the example document above shouldn't be returned)

This doesn't seem possible with an array field because the above doc is a match, probably due to the fact that the combined values of the array do contain all the words.

Any suggestions or ideas are welcome.

Thanks
Cos

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.