# Sorted queries

**URL:** <https://discuss.elastic.co/t/sorted-queries/17452>\
**Category:** Elasticsearch\
**Created:** [May 12, 2014, 5:31am UTC](https://discuss.elastic.co/t/sorted-queries/17452 "2014-05-12T05:31:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![slushi](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@slushi](https://discuss.elastic.co/u/slushi)\
**Post date:** [May 12, 2014, 5:31am UTC](https://discuss.elastic.co/t/sorted-queries/17452/1 "2014-05-12T05:31:47Z")

</div>

I am executing search requests with a sort defined. In this case, from a  
performance perspective is it better to do a match\_all query and then add  
the query as a filter or is it basically equivalent? Should I wrap the  
query in a constant score query to avoid any scoring overhead?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2a211811-4f3a-427b-bf0a-ffd32e9697bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2a211811-4f3a-427b-bf0a-ffd32e9697bd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [May 12, 2014, 5:34am UTC](https://discuss.elastic.co/t/sorted-queries/17452/2 "2014-05-12T05:34:23Z")

</div>

A match\_all query or a constant score query would be equivalent.

--  
Ivan

On Sun, May 11, 2014 at 10:31 PM, slushi [kireetreddy@gmail.com](mailto:kireetreddy@gmail.com) wrote:

> I am executing search requests with a sort defined. In this case, from a  
> performance perspective is it better to do a match\_all query and then add  
> the query as a filter or is it basically equivalent? Should I wrap the  
> query in a constant score query to avoid any scoring overhead?
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/2a211811-4f3a-427b-bf0a-ffd32e9697bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2a211811-4f3a-427b-bf0a-ffd32e9697bd%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/2a211811-4f3a-427b-bf0a-ffd32e9697bd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2a211811-4f3a-427b-bf0a-ffd32e9697bd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQC5LM10--NYy7XSRNxRqTcYhSpUvRptbD%2BWe8FbkJBbaA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQC5LM10--NYy7XSRNxRqTcYhSpUvRptbD%2BWe8FbkJBbaA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:30am UTC](https://discuss.elastic.co/t/sorted-queries/17452/3 "2017-07-06T01:30:14Z")

</div>


