# Ordering and filters

**URL:** <https://discuss.elastic.co/t/ordering-and-filters/12151>\
**Category:** Elasticsearch\
**Created:** [May 28, 2013, 1:39pm UTC](https://discuss.elastic.co/t/ordering-and-filters/12151 "2013-05-28T13:39:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian\_3](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@christian\_3](https://discuss.elastic.co/u/christian_3)\
**Post date:** [May 28, 2013, 1:39pm UTC](https://discuss.elastic.co/t/ordering-and-filters/12151/1 "2013-05-28T13:39:28Z")

</div>

Hello,

when using an and filters is there a way to order them? The reason I ask is  
that my geo\_shape filter is the slowest, so it would be great if I could  
apply the other filters (mostly range and booleans) first, so that the  
geo\_shape filter has a smaller set of documents to query against.

--  
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 28, 2013, 3:25pm UTC](https://discuss.elastic.co/t/ordering-and-filters/12151/2 "2013-05-28T15:25:46Z")

</div>

Just put it last in list of filters you pass to `and`

On 28 May 2013 15:39, [christian@zoomsquare.com](mailto:christian@zoomsquare.com) wrote:

> Hello,
> 
> when using an and filters is there a way to order them? The reason I ask  
> is that my geo\_shape filter is the slowest, so it would be great if I could  
> apply the other filters (mostly range and booleans) first, so that the  
> geo\_shape filter has a smaller set of documents to query against.
> 
> --  
> 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:** ![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:34am UTC](https://discuss.elastic.co/t/ordering-and-filters/12151/3 "2017-07-06T02:34:19Z")

</div>


