# Get every n-th result ordered by date

**URL:** https://discuss.elastic.co/t/get-every-n-th-result-ordered-by-date/21770
**Category:** Elasticsearch
**Created:** [January 22, 2015, 8:43am UTC](https://discuss.elastic.co/t/get-every-n-th-result-ordered-by-date/21770 "2015-01-22T08:43:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Timo\_Schmidt](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@Timo\_Schmidt](https://discuss.elastic.co/u/Timo_Schmidt)
#### Post date: [January 22, 2015, 8:43am UTC](https://discuss.elastic.co/t/get-every-n-th-result-ordered-by-date/21770/1 "2015-01-22T08:43:31Z")

</div>

Hello together,

i have the following use case:

1. Let's say i have 1000 Documents in my index.
2. I want to sort them by date
3. And just have every n-th document (modulo) in my response

Is this somehow possible? I thried to implement a native plugin, with a as  
a script filter in the post filter but i could not figure out, how to  
access the position in the resultset.  
Any other ideads?

--  
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/f74704f9-7e12-4c8f-a743-71d574b3196c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f74704f9-7e12-4c8f-a743-71d574b3196c%40googlegroups.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, 12:37am UTC](https://discuss.elastic.co/t/get-every-n-th-result-ordered-by-date/21770/2 "2017-07-06T00:37:19Z")

</div>


