# Re: multi-term multi-field search

**URL:** <https://discuss.elastic.co/t/re-multi-term-multi-field-search/7077>\
**Category:** Elasticsearch\
**Created:** [March 20, 2012, 8:51pm UTC](https://discuss.elastic.co/t/re-multi-term-multi-field-search/7077 "2012-03-20T20:51:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 20, 2012, 8:51pm UTC](https://discuss.elastic.co/t/re-multi-term-multi-field-search/7077/1 "2012-03-20T20:51:45Z")

</div>

You can combine a text query on each field, and wrap it in a bool query  
placing all teh relevant text queries as should clauses.

On Tue, Mar 20, 2012 at 4:59 PM, Giorgio Salluzzo \<  
[giorgio.salluzzo@gmail.com](mailto:giorgio.salluzzo@gmail.com)\> wrote:

> Hi there,  
> in my company we are trying to port all our search platform to  
> Elasticsearch. I can't understand how to perform a query to obtain  
> something as follows:
> 
> - title, subject and body are some fields of my documents;
> - 'a', 'b', 'c', 'd' are the words in my query string;
> - the result should match all the following:
> - title = "... b ... a ... c ... d ..."; // all words in a field
> - title = "... b ... a ... d ..." , subject = "... a ..." , body =  
> "... a ... c ..."; // all words found in one or more field
> - title = " .... " , subject = " ... a ... c ..." , body =" ...  
> b ... d ...".
> 
> If one word -or more- is not in at least one field the resultset  
> should be empty.
> 
> Thanks in advance.
> 
> Regards,  
> Giorgio

---

<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, 3:35am UTC](https://discuss.elastic.co/t/re-multi-term-multi-field-search/7077/2 "2017-07-06T03:35:21Z")

</div>


