# Shuffle the index sorting for match\_all

**URL:** <https://discuss.elastic.co/t/shuffle-the-index-sorting-for-match-all/15827>\
**Category:** Elasticsearch\
**Created:** [February 16, 2014, 9:15am UTC](https://discuss.elastic.co/t/shuffle-the-index-sorting-for-match-all/15827 "2014-02-16T09:15:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel\_Gavilan\_gavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_gavilan_gavi/32/961_2.png) [@Gabriel\_Gavilan\_gavi](https://discuss.elastic.co/u/Gabriel_Gavilan_gavi)\
**Post date:** [February 16, 2014, 9:15am UTC](https://discuss.elastic.co/t/shuffle-the-index-sorting-for-match-all/15827/1 "2014-02-16T09:15:12Z")

</div>

I want to shuffle the index so that when I get the documents with  
"match\_all" they don't appear in chronological order.

Here's the question with details on stackoverflow:

> <https://stackoverflow.com/questions/21802009/elasticsearch-shuffle-index-sorting>

I will appreciate any help.

--  
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/43e904a0-156d-486f-9856-5282bdf3bb86%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/43e904a0-156d-486f-9856-5282bdf3bb86%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 16, 2014, 12:52pm UTC](https://discuss.elastic.co/t/shuffle-the-index-sorting-for-match-all/15827/2 "2014-02-16T12:52:53Z")

</div>

Use function score with random scoring.

Should help.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 16 févr. 2014 à 10:15, Gabriel Gavilan gavilán [gumymoxy@gmail.com](mailto:gumymoxy@gmail.com) a écrit :

> I want to shuffle the index so that when I get the documents with "match\_all" they don't appear in chronological order.
> 
> Here's the question with details on stackoverflow:  
> [lucene - Elasticsearch shuffle index sorting - Stack Overflow](http://stackoverflow.com/questions/21802009/elasticsearch-shuffle-index-sorting)
> 
> ## I will appreciate any help.
> 
> 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/43e904a0-156d-486f-9856-5282bdf3bb86%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/43e904a0-156d-486f-9856-5282bdf3bb86%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6936E70C-92BF-43D7-8AFB-15AE87EA281B%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/6936E70C-92BF-43D7-8AFB-15AE87EA281B%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Gabriel\_Gavilan\_gavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_gavilan_gavi/32/961_2.png) [@Gabriel\_Gavilan\_gavi](https://discuss.elastic.co/u/Gabriel_Gavilan_gavi)\
**Post date:** [February 16, 2014, 6:44pm UTC](https://discuss.elastic.co/t/shuffle-the-index-sorting-for-match-all/15827/3 "2014-02-16T18:44:52Z")

</div>

Thank you very much, I wouldn't have found this option on my own 🙂

Here's the query I used:

{ "from":STARTING\_POSITION\_NUMBER, "size":15, "query" : { "function\_score": { "random\_score": { "seed" : 1 } } } }

El domingo, 16 de febrero de 2014 13:52:53 UTC+1, David Pilato escribió:

> Use function score with random scoring.
> 
> Should help.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 16 févr. 2014 à 10:15, Gabriel Gavilan gavilán \<[gumy...@gmail.com](mailto:gumy...@gmail.com)\<javascript:\>\>  
> a écrit :
> 
> I want to shuffle the index so that when I get the documents with  
> "match\_all" they don't appear in chronological order.
> 
> Here's the question with details on stackoverflow:
> 
> [lucene - Elasticsearch shuffle index sorting - Stack Overflow](http://stackoverflow.com/questions/21802009/elasticsearch-shuffle-index-sorting)
> 
> I will appreciate any help.
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/43e904a0-156d-486f-9856-5282bdf3bb86%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/43e904a0-156d-486f-9856-5282bdf3bb86%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9d438798-6c86-4fb3-95a6-a27dfb1e6790%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d438798-6c86-4fb3-95a6-a27dfb1e6790%40googlegroups.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, 1:49am UTC](https://discuss.elastic.co/t/shuffle-the-index-sorting-for-match-all/15827/4 "2017-07-06T01:49:49Z")

</div>


