# Must match all tokens without using \_all field

**URL:** <https://discuss.elastic.co/t/must-match-all-tokens-without-using--all-field/11998>\
**Category:** Elasticsearch\
**Created:** [May 16, 2013, 10:33pm UTC](https://discuss.elastic.co/t/must-match-all-tokens-without-using--all-field/11998 "2013-05-16T22:33:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tinou\_Bao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tinou_bao/32/1736_2.png) [@Tinou\_Bao](https://discuss.elastic.co/u/Tinou_Bao)\
**Post date:** [May 16, 2013, 10:33pm UTC](https://discuss.elastic.co/t/must-match-all-tokens-without-using--all-field/11998/1 "2013-05-16T22:33:07Z")

</div>

My example:

Book

- name
- description
- author

I want to find all books that have the words "red" and "blue" in the name  
or description fields. So I do a match w/ operator "OR" against fields name  
and description. BUT both red and blue must appear.

name: red  
description: blue  
author: foo

name: blue  
description: red  
author: foo

name: blue red  
description: blue  
author: foo

All books above would match. But this would not match:

name: red  
description: pink  
author: foo

since it doesn't have blue.

I can do this by also specifying that "red" and "blue" match the "\_all"  
field (using the AND operator for "red blue". BUT I would like to NOT use  
the \_all field...  
is it possible for me to? Can't figure out how to do this without using the  
\_all field....

-T

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [May 17, 2013, 10:51am UTC](https://discuss.elastic.co/t/must-match-all-tokens-without-using--all-field/11998/2 "2013-05-17T10:51:45Z")

</div>

Have a look at this answer:

> <https://stackoverflow.com/questions/15423033/multi-field-multi-word-match-without-query-string/15430238#15430238>

On 17 May 2013 00:33, Tinou Bao [tinou.bao@gmail.com](mailto:tinou.bao@gmail.com) wrote:

> My example:
> 
> Book
> 
> - name
> - description
> - author
> 
> I want to find all books that have the words "red" and "blue" in the name  
> or description fields. So I do a match w/ operator "OR" against fields name  
> and description. BUT both red and blue must appear.
> 
> name: red  
> description: blue  
> author: foo
> 
> name: blue  
> description: red  
> author: foo
> 
> name: blue red  
> description: blue  
> author: foo
> 
> All books above would match. But this would not match:
> 
> name: red  
> description: pink  
> author: foo
> 
> since it doesn't have blue.
> 
> I can do this by also specifying that "red" and "blue" match the "\_all"  
> field (using the AND operator for "red blue". BUT I would like to NOT use  
> the \_all field...  
> is it possible for me to? Can't figure out how to do this without using  
> the \_all field....
> 
> -T
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![EndaRecar](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@EndaRecar](https://discuss.elastic.co/u/EndaRecar)\
**Post date:** [June 19, 2014, 8:43am UTC](https://discuss.elastic.co/t/must-match-all-tokens-without-using--all-field/11998/3 "2014-06-19T08:43:57Z")

</div>

Hair extensions and hairpieces really can help to improve the looking of people and help to change them a lot hair extensions and hairpieces if choosing the right type and right style of hair wigs for you, of course that you will look and become more and more attractive and also buy cheap hair wigs now is easy as you can just get the ideal style that you want online at online shops now. I have just buy me a **[bang wigs](http://www.hairwigsall.com/categories/BANGS-STYLE/)** and it is perfect.

---

<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, 1:21am UTC](https://discuss.elastic.co/t/must-match-all-tokens-without-using--all-field/11998/4 "2017-07-06T01:21:16Z")

</div>


