Elasticsearch, match any possible exact value of an Array in an Array
<p>I want to query for all the documents that match any of the following values:</p>

<pre><code>["Test","Cat","Dog"]
</code></pre>

<p>in the field categories.</p>

<p>I have the following mapping:</p>

<pre><code>"categories": {
    "type": "string"
}
</code></pre>

<p>A couple of sample documents are </p>

<pre><code>"categories": [
    "Test",
    "Cat"
]
</code></pre>

<p>Or</p>

<pre><code>"categories": [
    "Blue Cat",
    "Ball"
]
</code></pre>

<p>I was able to pull it off with the following query:</p>

<pre><code>query: {
    match: {
        categories: {
            query: ["Test","Cat","Dog"]
        }
    }
</code></pre>

<p>But that would return me both Documents because they both include "Cat" even tho one of them include it in the form of "Blue Cat", how can I specify they I want the exact value "Cat" not that it includes it?</p>

<p>I read about changing the field type on the mapping to nested, but an array is not accepted as a nested object since it doesn't have keys and values.</p>

<p>If I use this mapping:</p>

<pre><code>"categories": {
    "type": "nested"
}
</code></pre>

<p>I get this error:</p>

<pre><code>"object mapping for [categories] tried to parse field [null] as object, but found a concrete value"
</code></pre>

<p>How can I filter by the field categories using an array of possible values and making sure it matches at least one of the values exactly?</p>