# How to merge terms and match\_all

**URL:** <https://discuss.elastic.co/t/how-to-merge-terms-and-match-all/22847>\
**Category:** Elasticsearch\
**Created:** [March 24, 2015, 9:06am UTC](https://discuss.elastic.co/t/how-to-merge-terms-and-match-all/22847 "2015-03-24T09:06:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tao\_hiko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tao_hiko/32/707_2.png) [@tao\_hiko](https://discuss.elastic.co/u/tao_hiko)\
**Post date:** [March 24, 2015, 9:06am UTC](https://discuss.elastic.co/t/how-to-merge-terms-and-match-all/22847/1 "2015-03-24T09:06:07Z")

</div>

Hi Guys,

I'm trying to merge both statement to one search as below detail

_1. query.terms : I get filter set ("A","B","C") from drop down list on  
webpage_

{

"query": {

```
"filtered": {

  "query": {

    "bool": {

      "should": [

        {

          "terms": {

            "field1.raw": [

                "A","B","C"

            ]

          }

        }

      ]

    }

  }

}

```

}

}

_2. query.match : I get filter data ("D E F") from text box on webpage  
(Universal Search)_

{

"query": {

```
"filtered": {

  "query": {

    "match": {

      "_all": "D E F"

    }

  }

}

```

}

}

So I need to search by get filter information from drop down and text box  
on webpage to query data in ES in same time, Is it possible?

If you need more informatin, please let me know.

Thanks  
Hiko

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8587e6ca-3035-4b91-9652-a4562902a616%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8587e6ca-3035-4b91-9652-a4562902a616%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:24am UTC](https://discuss.elastic.co/t/how-to-merge-terms-and-match-all/22847/2 "2017-07-06T00:24:33Z")

</div>


