# Elastic search query using a list

**URL:** <https://discuss.elastic.co/t/elastic-search-query-using-a-list/259439>\
**Category:** Elasticsearch\
**Created:** [December 23, 2020, 3:15am UTC](https://discuss.elastic.co/t/elastic-search-query-using-a-list/259439 "2020-12-23T03:15:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shantanuo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shantanuo/32/10141_2.png) [@shantanuo](https://discuss.elastic.co/u/shantanuo)\
**Post date:** [December 23, 2020, 3:15am UTC](https://discuss.elastic.co/t/elastic-search-query-using-a-list/259439/1 "2020-12-23T03:15:56Z")

</div>

How do I pass a list as query string to match\_phrase query?

This works:

```auto
`{"match_phrase": {"requestParameters.bucketName": {"query": "auditloggingnew2232"}}},`

```

This does not:

```auto
    {
        "match_phrase": {
            "requestParameters.bucketName": {
                "query": [
                    "auditloggingnew2232",
                    "config-bucket-123",
                    "web-servers",
                    "esbck-essnap-1djjegwy9fvyl",
                    "tempexpo",
                ]
            }
        }
    }

```

I am aware that a "bool" query is required for this. But that query will be very lengthy and complicated. Is there any way to create an alias for boolean query so that I can use the syntax mentioned above?

---

<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:** [January 20, 2021, 3:16am UTC](https://discuss.elastic.co/t/elastic-search-query-using-a-list/259439/2 "2021-01-20T03:16:33Z")

</div>

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