# Filters vs Queries

**URL:** <https://discuss.elastic.co/t/filters-vs-queries/5558>\
**Category:** Elasticsearch\
**Created:** [October 11, 2011, 9:05am UTC](https://discuss.elastic.co/t/filters-vs-queries/5558 "2011-10-11T09:05:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Berkhout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_berkhout/32/3058_2.png) [@Chris\_Berkhout](https://discuss.elastic.co/u/Chris_Berkhout)\
**Post date:** [October 11, 2011, 9:05am UTC](https://discuss.elastic.co/t/filters-vs-queries/5558/1 "2011-10-11T09:05:45Z")

</div>

Hi everyone,

The choice between filters and regular 'must' query conditions is  
basically about performance, right?

Because filters can be cached better and don't do scoring.

I'm using the Tire gem, but apparently it doesn't do multiple filters  
at the moment, so I'm thinking of making them regular boolean  
conditions for now.

Cheers,  
Chris

---

<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:** [October 11, 2011, 9:20am UTC](https://discuss.elastic.co/t/filters-vs-queries/5558/2 "2011-10-11T09:20:01Z")

</div>

HI Chris

> The choice between filters and regular 'must' query conditions is  
> basically about performance, right?
> 
> Because filters can be cached better and don't do scoring.

Correct

> I'm using the Tire gem, but apparently it doesn't do multiple filters  
> at the moment, so I'm thinking of making them regular boolean  
> conditions for now.

I don't know the API of the Tire gem, but you should be able to combine  
multiple filters using the and|or|not filters (in a similar way to the  
bool query/filter)

clint

---

<div class="post-metadata">

**Author:** ![Chris\_Berkhout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_berkhout/32/3058_2.png) [@Chris\_Berkhout](https://discuss.elastic.co/u/Chris_Berkhout)\
**Post date:** [October 11, 2011, 9:23am UTC](https://discuss.elastic.co/t/filters-vs-queries/5558/3 "2011-10-11T09:23:12Z")

</div>

Thanks Clint!

On Tue, Oct 11, 2011 at 5:20 PM, Clinton Gormley [clint@traveljury.com](mailto:clint@traveljury.com) wrote:

> HI Chris
> 
> > The choice between filters and regular 'must' query conditions is  
> > basically about performance, right?
> > 
> > Because filters can be cached better and don't do scoring.
> 
> Correct
> 
> > I'm using the Tire gem, but apparently it doesn't do multiple filters  
> > at the moment, so I'm thinking of making them regular boolean  
> > conditions for now.
> 
> I don't know the API of the Tire gem, but you should be able to combine  
> multiple filters using the and|or|not filters (in a similar way to the  
> bool query/filter)
> 
> clint

---

<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/filters-vs-queries/5558/4 "2017-07-06T03:52:25Z")

</div>


