# ES 6.X C reate a match query that queries a string array

**URL:** <https://discuss.elastic.co/t/es-6-x-c-reate-a-match-query-that-queries-a-string-array/148417>\
**Category:** Elasticsearch\
**Created:** [September 13, 2018, 7:31am UTC](https://discuss.elastic.co/t/es-6-x-c-reate-a-match-query-that-queries-a-string-array/148417 "2018-09-13T07:31:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MiguelSalenda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguelsalenda/32/33152_2.png) [@MiguelSalenda](https://discuss.elastic.co/u/MiguelSalenda)\
**Post date:** [September 13, 2018, 7:31am UTC](https://discuss.elastic.co/t/es-6-x-c-reate-a-match-query-that-queries-a-string-array/148417/1 "2018-09-13T07:31:35Z")

</div>

Hello all,

I'm trying to refactor a ES 1.7 query that uses a match query that queries a string array into a ES 6.X query.

Here is the query in 1.7:

```auto
{
    "query": {
        "bool": {
        	"must": {
        		"match": {
        			"name": {
        				"query": ["name1","name2"],
        				"operator" : "and"
        			}
        		}
        	}
        }
    }
}

```

But in ES 6.X this query doesn't work, throwing this exception: `[match] unknown token [START_ARRAY] after [query]`.

So, what would be the best way to transform this query in EX 6.X? What I wouldto do is a match query that queries in field "name" a list of values, in this case "name1 and "name2".

Don't hesitate to correct the query, because I don't know if the 1.7 query is well-formed.

Thanks in advance!

Regards,  
Miguel.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 11, 2018, 7:38am UTC](https://discuss.elastic.co/t/es-6-x-c-reate-a-match-query-that-queries-a-string-array/148417/2 "2018-10-11T07:38:18Z")

</div>

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