# Offset Search Results which matches a Query

**URL:** https://discuss.elastic.co/t/offset-search-results-which-matches-a-query/14752
**Category:** Elasticsearch
**Created:** [December 6, 2013, 4:51pm UTC](https://discuss.elastic.co/t/offset-search-results-which-matches-a-query/14752 "2013-12-06T16:51:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Robert\_Schoenthal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robert_schoenthal/32/1784_2.png) [@Robert\_Schoenthal](https://discuss.elastic.co/u/Robert_Schoenthal)
#### Post date: [December 6, 2013, 4:51pm UTC](https://discuss.elastic.co/t/offset-search-results-which-matches-a-query/14752/1 "2013-12-06T16:51:02Z")

</div>

Hey there,

is there a way to offset a subset of elements in my search-result if they  
match a certain criteria?

Imagine the following: "find all but not the first 5 which have the  
attribute "foo" set to true"?

i've created a gist here: [https://gist.github.com/digitalkaoz/7827078](https://gist.github.com/digitalkaoz/7827078)

is this generally possible or am i doing it completly wrong?

Cheers  
Robert

--  
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/5805012e-9571-438e-a7c0-bae53f2ea248%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5805012e-9571-438e-a7c0-bae53f2ea248%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: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [December 6, 2013, 5:10pm UTC](https://discuss.elastic.co/t/offset-search-results-which-matches-a-query/14752/2 "2013-12-06T17:10:11Z")

</div>

What about `from` in the request body search? You'll have to make sure  
the sorting is consistent, though.

On Fri, Dec 6, 2013 at 11:51 AM, Robert Schoenthal [seroscho@gmail.com](mailto:seroscho@gmail.com)wrote:

> Hey there,
> 
> is there a way to offset a subset of elements in my search-result if they  
> match a certain criteria?
> 
> Imagine the following: "find all but not the first 5 which have the  
> attribute "foo" set to true"?
> 
> i've created a gist here: [Elasticsearch Query Filtering... · GitHub](https://gist.github.com/digitalkaoz/7827078)
> 
> is this generally possible or am i doing it completly wrong?
> 
> Cheers  
> Robert
> 
> --  
> 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/5805012e-9571-438e-a7c0-bae53f2ea248%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5805012e-9571-438e-a7c0-bae53f2ea248%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/CAPmjWd2fYHLXwvvFbjLgFhdgd%2BW4UmzN2sP5iNFz\_bpGAKi9pA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2fYHLXwvvFbjLgFhdgd%2BW4UmzN2sP5iNFz_bpGAKi9pA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Robert\_Schoenthal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robert_schoenthal/32/1784_2.png) [@Robert\_Schoenthal](https://discuss.elastic.co/u/Robert_Schoenthal)
#### Post date: [December 8, 2013, 6:42pm UTC](https://discuss.elastic.co/t/offset-search-results-which-matches-a-query/14752/3 "2013-12-08T18:42:57Z")

</div>

But "from" only offsets the whole results. i want to offset only some  
results which matches a query...

any other ideas?

Am Freitag, 6. Dezember 2013 18:10:11 UTC+1 schrieb Nikolas Everett:

> What about `from` in the request body search? You'll have to make  
> sure the sorting is consistent, though.
> 
> On Fri, Dec 6, 2013 at 11:51 AM, Robert Schoenthal \<[sero...@gmail.com](mailto:sero...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hey there,
> > 
> > is there a way to offset a subset of elements in my search-result if they  
> > match a certain criteria?
> > 
> > Imagine the following: "find all but not the first 5 which have the  
> > attribute "foo" set to true"?
> > 
> > i've created a gist here: [Elasticsearch Query Filtering... · GitHub](https://gist.github.com/digitalkaoz/7827078)
> > 
> > is this generally possible or am i doing it completly wrong?
> > 
> > Cheers  
> > Robert
> > 
> > --  
> > 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/5805012e-9571-438e-a7c0-bae53f2ea248%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5805012e-9571-438e-a7c0-bae53f2ea248%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/aa119e0c-28b0-49e0-acd5-fe435eedddfd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aa119e0c-28b0-49e0-acd5-fe435eedddfd%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, 2:02am UTC](https://discuss.elastic.co/t/offset-search-results-which-matches-a-query/14752/4 "2017-07-06T02:02:37Z")

</div>


