# Using multiple analyzer in query

**URL:** <https://discuss.elastic.co/t/using-multiple-analyzer-in-query/98316>\
**Category:** Elasticsearch\
**Created:** [August 25, 2017, 4:49am UTC](https://discuss.elastic.co/t/using-multiple-analyzer-in-query/98316 "2017-08-25T04:49:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![priyank](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@priyank](https://discuss.elastic.co/u/priyank)\
**Post date:** [August 25, 2017, 4:49am UTC](https://discuss.elastic.co/t/using-multiple-analyzer-in-query/98316/1 "2017-08-25T04:49:37Z")

</div>

I want to implement Synonym and Stopword Filters in my query. For that I created analayers and both are working fine individual. But I want to use them both how can I?

```
GET my_index/_search/
{
    "query": {
        "match": {
           "_all": {
             "query": "Good and Bad",
             "analyzer": [
                 "stop_analyzer",
                 "synonym"
             ]
           }
        }
    }
}

```

The above query throws me an error

I think I cant use an array or an object there as when I use single analyzer like "analyzer": "stop\_analyzer" or "analyzer": "synonym" it works great. So my question is how can I use both?

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [August 26, 2017, 7:45pm UTC](https://discuss.elastic.co/t/using-multiple-analyzer-in-query/98316/2 "2017-08-26T19:45:40Z")

</div>

A field can have only one analysis chain. You need to create an analyzer  
composed with the two filters. An analyzer is comprised of character  
filters (pre-tokenization), a tokenizer, and filters (post-tokenization).

---

<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:** [September 23, 2017, 7:45pm UTC](https://discuss.elastic.co/t/using-multiple-analyzer-in-query/98316/3 "2017-09-23T19:45:52Z")

</div>

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