# Bool Filter - Does "should" has an effect if "must" is defined?

**URL:** <https://discuss.elastic.co/t/bool-filter-does-should-has-an-effect-if-must-is-defined/5448>\
**Category:** Elasticsearch\
**Created:** [September 26, 2011, 11:49am UTC](https://discuss.elastic.co/t/bool-filter-does-should-has-an-effect-if-must-is-defined/5448 "2011-09-26T11:49:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maho](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@maho](https://discuss.elastic.co/u/maho)\
**Post date:** [September 26, 2011, 11:49am UTC](https://discuss.elastic.co/t/bool-filter-does-should-has-an-effect-if-must-is-defined/5448/1 "2011-09-26T11:49:58Z")

</div>

Hi,

in Lucene, filter doesn't affect the computation of the score of the  
non-filtered documents.  
So if i use a bool filter with "should" it should have no effect if I  
also use "must".

Is that correct?

---

<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:** [October 2, 2011, 7:57am UTC](https://discuss.elastic.co/t/bool-filter-does-should-has-an-effect-if-must-is-defined/5448/2 "2011-10-02T07:57:27Z")

</div>

Yes, if its a filter.

On Mon, Sep 26, 2011 at 2:49 PM, maho [mathias.hodler@gmail.com](mailto:mathias.hodler@gmail.com) wrote:

> Hi,
> 
> in Lucene, filter doesn't affect the computation of the score of the  
> non-filtered documents.  
> So if i use a bool filter with "should" it should have no effect if I  
> also use "must".
> 
> Is that correct?

---

<div class="post-metadata">

**Author:** ![maho](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@maho](https://discuss.elastic.co/u/maho)\
**Post date:** [October 6, 2011, 2:12pm UTC](https://discuss.elastic.co/t/bool-filter-does-should-has-an-effect-if-must-is-defined/5448/3 "2011-10-06T14:12:25Z")

</div>

Thank you.

I was little bit confused, because in the example all three bool  
operators are used: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html).

On 2 Okt., 09:57, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Yes, if its a filter.
> 
> On Mon, Sep 26, 2011 at 2:49 PM, maho [mathias.hod...@gmail.com](mailto:mathias.hod...@gmail.com) wrote:
> 
> > Hi,
> 
> > in Lucene, filter doesn't affect the computation of the score of the  
> > non-filtered documents.  
> > So if i use a bool filter with "should" it should have no effect if I  
> > also use "must".
> 
> > Is that correct?

---

<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:52am UTC](https://discuss.elastic.co/t/bool-filter-does-should-has-an-effect-if-must-is-defined/5448/4 "2017-07-06T03:52:43Z")

</div>

Closed on July 6, 2017, 3:52am UTC


