# Sort order on a wildcard query with constant score

**URL:** <https://discuss.elastic.co/t/sort-order-on-a-wildcard-query-with-constant-score/133815>\
**Category:** Elasticsearch\
**Created:** [May 30, 2018, 8:09am UTC](https://discuss.elastic.co/t/sort-order-on-a-wildcard-query-with-constant-score/133815 "2018-05-30T08:09:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimalini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dimalini/32/22448_2.png) [@dimalini](https://discuss.elastic.co/u/dimalini)\
**Post date:** [May 30, 2018, 8:09am UTC](https://discuss.elastic.co/t/sort-order-on-a-wildcard-query-with-constant-score/133815/1 "2018-05-30T08:09:34Z")

</div>

I noticed in a wildcard query on a particular field (type:string) with rewrite as 'constant\_score', the expanded results returned were in random order. I expected the results returned will be alphabetically ascending as they all have a constant score of 1.

Are the results expected to be randomly sorted? In that case set of terms that the wildcard expanded to could be a random set that possibly may not be the same every time?

---

<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:** [June 27, 2018, 8:09am UTC](https://discuss.elastic.co/t/sort-order-on-a-wildcard-query-with-constant-score/133815/2 "2018-06-27T08:09:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
