# Discard results in boolean queries under conditions

**URL:** <https://discuss.elastic.co/t/discard-results-in-boolean-queries-under-conditions/13971>\
**Category:** Elasticsearch\
**Created:** [October 16, 2013, 2:52pm UTC](https://discuss.elastic.co/t/discard-results-in-boolean-queries-under-conditions/13971 "2013-10-16T14:52:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mromagnoli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mromagnoli/32/839_2.png) [@mromagnoli](https://discuss.elastic.co/u/mromagnoli)\
**Post date:** [October 16, 2013, 2:52pm UTC](https://discuss.elastic.co/t/discard-results-in-boolean-queries-under-conditions/13971/1 "2013-10-16T14:52:57Z")

</div>

Hi group, I've been wondering if is there some method where I can discard  
results in boolean queries if the 'should' part does not find anything.  
I am querying with 'should' and 'must' parts, but for me is only relevant  
if there is some result 'in the should section'. Was I clear?¿

Thanks in advance 😉

--  
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:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 16, 2013, 3:01pm UTC](https://discuss.elastic.co/t/discard-results-in-boolean-queries-under-conditions/13971/2 "2013-10-16T15:01:03Z")

</div>

On Wed, Oct 16, 2013 at 10:52 AM, Marce Romagnoli \<[marce.romagnoli@gmail.com](mailto:marce.romagnoli@gmail.com)

> wrote:

> Hi group, I've been wondering if is there some method where I can discard  
> results in boolean queries if the 'should' part does not find anything.  
> I am querying with 'should' and 'must' parts, but for me is only relevant  
> if there is some result 'in the should section'. Was I clear?¿

Are you looking for minimum\_should\_match?

--  
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:** ![mromagnoli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mromagnoli/32/839_2.png) [@mromagnoli](https://discuss.elastic.co/u/mromagnoli)\
**Post date:** [October 16, 2013, 3:58pm UTC](https://discuss.elastic.co/t/discard-results-in-boolean-queries-under-conditions/13971/3 "2013-10-16T15:58:16Z")

</div>

Ohh thats right! Now I feel kind of embarrassing, it was there in the docs  
hehe.

Thanks Nikolas!

El miércoles, 16 de octubre de 2013 12:01:03 UTC-3, Nikolas Everett  
escribió:

> On Wed, Oct 16, 2013 at 10:52 AM, Marce Romagnoli \<[marce.r...@gmail.com](mailto:marce.r...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi group, I've been wondering if is there some method where I can discard  
> > results in boolean queries if the 'should' part does not find anything.  
> > I am querying with 'should' and 'must' parts, but for me is only relevant  
> > if there is some result 'in the should section'. Was I clear?¿
> 
> Are you looking for minimum\_should\_match?

--  
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:** ![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, 2:12am UTC](https://discuss.elastic.co/t/discard-results-in-boolean-queries-under-conditions/13971/4 "2017-07-06T02:12:08Z")

</div>


