# Behavior of scrolling search with "from" parameter in newer ES versions

**URL:** https://discuss.elastic.co/t/behavior-of-scrolling-search-with-from-parameter-in-newer-es-versions/21739
**Category:** Elasticsearch
**Created:** [January 20, 2015, 10:33pm UTC](https://discuss.elastic.co/t/behavior-of-scrolling-search-with-from-parameter-in-newer-es-versions/21739 "2015-01-20T22:33:01Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Gordon\_Tillman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gordon_tillman/32/984_2.png) [@Gordon\_Tillman](https://discuss.elastic.co/u/Gordon_Tillman)
#### Post date: [January 20, 2015, 10:33pm UTC](https://discuss.elastic.co/t/behavior-of-scrolling-search-with-from-parameter-in-newer-es-versions/21739/1 "2015-01-20T22:33:01Z")

</div>

Greetings All,

I ran into an interesting issue when upgrading from ES version 1.0.1 to  
newer versions. In particular, I tested the following with versions 1.2.4,  
1.3.4 and 1.4.2.

_summary_

When doing a normal scroll search (not one with a _search\_type=scan_), it  
appears that the "from" parameter is being ignored.

_example 1 (no scrolling, result is correct)_

In this simplified example, only one document matches the supplied query,  
so with _from=1_ no documents are returned.

curl  
localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:c10ed0583104036a94e110f0a8b5fd7d4&from=1

_example 2 (with scrolling, incorrect result)_

In this example, where we specify the same query and from parameters, but  
also specify a scroll parameter, we incorrectly get the single document  
returned from the query.

curl  
localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:c10ed0583104036a94e110f0a8b5fd7d4&from=1&scroll=2s  
| json

_notes_

1. Both of the above test cases work correctly in version 1.0.1
2. In newer versions (where example 2 fails), I noticed that the _from_  
value is not present in the data that was returned from the query.

I understand with with a \*search\_type=scan, \*this would be expected because  
sorting is disabled. Also, please note this is a greatly simplified query  
just for illustration purposes. I've attached a sample of an actual query  
at the bottom of this post, and _it does contain sorting specifications_.

Is this a known issue or is this being done by design in the newer ES  
versions. A quick scan through the release notes was unrevealing.

Many thanks for any insight!

--g

_sample of full query_

{  
"sort": [  
{  
"\_type": {  
"order": "asc",  
"ignore\_unmapped": true  
}  
},  
{  
"name\_lower": {  
"order": "asc",  
"ignore\_unmapped": true  
}  
},  
{  
"dds\_key": {  
"order": "asc",  
"ignore\_unmapped": true  
}  
}  
],  
"query": {  
"filtered": {  
"filter": {  
"and": [  
{  
"or": [  
{  
"term": {  
"parent":  
"c10ed0583104012f94e11ad0ac36f2aaf"  
}  
}  
]  
},  
{  
"not": {  
"term": {  
"vcn": "DeleteMarker"  
}  
}  
},  
{  
"not": {  
"exists": {  
"field": "notfinalized"  
}  
}  
}  
]  
},  
"query": {  
"match\_all": {}  
}  
}  
},  
"from": 1,  
"size": 1000  
}

--  
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/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [January 21, 2015, 8:57am UTC](https://discuss.elastic.co/t/behavior-of-scrolling-search-with-from-parameter-in-newer-es-versions/21739/2 "2015-01-21T08:57:00Z")

</div>

Hi Gordon,

This `from` is kind of ignored for scroll search. I don't remember why that  
was the case, but it seems to me that scroll search can/should take into  
account the `from` option during the first scroll search request.

Martijn

On 20 January 2015 at 23:33, Gordon Tillman [gordyt@gmail.com](mailto:gordyt@gmail.com) wrote:

> Greetings All,
> 
> I ran into an interesting issue when upgrading from ES version 1.0.1 to  
> newer versions. In particular, I tested the following with versions 1.2.4,  
> 1.3.4 and 1.4.2.
> 
> _summary_
> 
> When doing a normal scroll search (not one with a _search\_type=scan_), it  
> appears that the "from" parameter is being ignored.
> 
> _example 1 (no scrolling, result is correct)_
> 
> In this simplified example, only one document matches the supplied query,  
> so with _from=1_ no documents are returned.
> 
> curl  
> localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:c10ed0583104036a94e110f0a8b5fd7d4&from=1
> 
> _example 2 (with scrolling, incorrect result)_
> 
> In this example, where we specify the same query and from parameters, but  
> also specify a scroll parameter, we incorrectly get the single document  
> returned from the query.
> 
> curl  
> localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:c10ed0583104036a94e110f0a8b5fd7d4&from=1&scroll=2s  
> | json
> 
> _notes_
> 
> 1. Both of the above test cases work correctly in version 1.0.1
> 2. In newer versions (where example 2 fails), I noticed that the _from_  
> value is not present in the data that was returned from the query.
> 
> I understand with with a \*search\_type=scan, \*this would be expected  
> because sorting is disabled. Also, please note this is a greatly  
> simplified query just for illustration purposes. I've attached a sample of  
> an actual query at the bottom of this post, and _it does contain sorting  
> specifications_.
> 
> Is this a known issue or is this being done by design in the newer ES  
> versions. A quick scan through the release notes was unrevealing.
> 
> Many thanks for any insight!
> 
> --g
> 
> _sample of full query_
> 
> {  
> "sort": [  
> {  
> "\_type": {  
> "order": "asc",  
> "ignore\_unmapped": true  
> }  
> },  
> {  
> "name\_lower": {  
> "order": "asc",  
> "ignore\_unmapped": true  
> }  
> },  
> {  
> "dds\_key": {  
> "order": "asc",  
> "ignore\_unmapped": true  
> }  
> }  
> ],  
> "query": {  
> "filtered": {  
> "filter": {  
> "and": [  
> {  
> "or": [  
> {  
> "term": {  
> "parent":  
> "c10ed0583104012f94e11ad0ac36f2aaf"  
> }  
> }  
> ]  
> },  
> {  
> "not": {  
> "term": {  
> "vcn": "DeleteMarker"  
> }  
> }  
> },  
> {  
> "not": {  
> "exists": {  
> "field": "notfinalized"  
> }  
> }  
> }  
> ]  
> },  
> "query": {  
> "match\_all": {}  
> }  
> }  
> },  
> "from": 1,  
> "size": 1000  
> }
> 
> --  
> 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/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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/CA%2BA76Tw7\_MvnXLAD\_4LrQUHvxasGkEUL%2BQRBbVv\_UDU3UAq1vg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BA76Tw7_MvnXLAD_4LrQUHvxasGkEUL%2BQRBbVv_UDU3UAq1vg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Gordon\_Tillman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gordon_tillman/32/984_2.png) [@Gordon\_Tillman](https://discuss.elastic.co/u/Gordon_Tillman)
#### Post date: [January 21, 2015, 1:27pm UTC](https://discuss.elastic.co/t/behavior-of-scrolling-search-with-from-parameter-in-newer-es-versions/21739/3 "2015-01-21T13:27:01Z")

</div>

Thanks Martijn,

That is what I have observed. But is is a regression from ES version 1.0.1  
and before. And I can't find anything that even implies that `from` is not  
supported for a scroll search, except of course when `search_type=scan`.

I would love to get support for that back into the product.

--g

On Wednesday, January 21, 2015 at 2:57:29 AM UTC-6, Martijn v Groningen  
wrote:

> Hi Gordon,
> 
> This `from` is kind of ignored for scroll search. I don't remember why  
> that was the case, but it seems to me that scroll search can/should take  
> into account the `from` option during the first scroll search request.
> 
> Martijn
> 
> On 20 January 2015 at 23:33, Gordon Tillman \<[gor...@gmail.com](mailto:gor...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Greetings All,
> > 
> > I ran into an interesting issue when upgrading from ES version 1.0.1 to  
> > newer versions. In particular, I tested the following with versions 1.2.4,  
> > 1.3.4 and 1.4.2.
> > 
> > _summary_
> > 
> > When doing a normal scroll search (not one with a _search\_type=scan_),  
> > it appears that the "from" parameter is being ignored.
> > 
> > _example 1 (no scrolling, result is correct)_
> > 
> > In this simplified example, only one document matches the supplied query,  
> > so with _from=1_ no documents are returned.
> > 
> > curl  
> > localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:c10ed0583104036a94e110f0a8b5fd7d4&from=1
> > 
> > _example 2 (with scrolling, incorrect result)_
> > 
> > In this example, where we specify the same query and from parameters, but  
> > also specify a scroll parameter, we incorrectly get the single document  
> > returned from the query.
> > 
> > curl  
> > localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:c10ed0583104036a94e110f0a8b5fd7d4&from=1&scroll=2s  
> > | json
> > 
> > _notes_
> > 
> > 1. Both of the above test cases work correctly in version 1.0.1
> > 2. In newer versions (where example 2 fails), I noticed that the  
> > _from_ value is not present in the data that was returned from the  
> > query.
> > 
> > I understand with with a \*search\_type=scan, \*this would be expected  
> > because sorting is disabled. Also, please note this is a greatly  
> > simplified query just for illustration purposes. I've attached a sample of  
> > an actual query at the bottom of this post, and _it does contain sorting  
> > specifications_.
> > 
> > Is this a known issue or is this being done by design in the newer ES  
> > versions. A quick scan through the release notes was unrevealing.
> > 
> > Many thanks for any insight!
> > 
> > --g
> > 
> > _sample of full query_
> > 
> > {  
> > "sort": [  
> > {  
> > "\_type": {  
> > "order": "asc",  
> > "ignore\_unmapped": true  
> > }  
> > },  
> > {  
> > "name\_lower": {  
> > "order": "asc",  
> > "ignore\_unmapped": true  
> > }  
> > },  
> > {  
> > "dds\_key": {  
> > "order": "asc",  
> > "ignore\_unmapped": true  
> > }  
> > }  
> > ],  
> > "query": {  
> > "filtered": {  
> > "filter": {  
> > "and": [  
> > {  
> > "or": [  
> > {  
> > "term": {  
> > "parent":  
> > "c10ed0583104012f94e11ad0ac36f2aaf"  
> > }  
> > }  
> > ]  
> > },  
> > {  
> > "not": {  
> > "term": {  
> > "vcn": "DeleteMarker"  
> > }  
> > }  
> > },  
> > {  
> > "not": {  
> > "exists": {  
> > "field": "notfinalized"  
> > }  
> > }  
> > }  
> > ]  
> > },  
> > "query": {  
> > "match\_all": {}  
> > }  
> > }  
> > },  
> > "from": 1,  
> > "size": 1000  
> > }
> > 
> > --  
> > 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/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen

--  
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/a4f5abd9-2f1f-4d1d-8168-260b4769d268%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a4f5abd9-2f1f-4d1d-8168-260b4769d268%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [January 21, 2015, 2:03pm UTC](https://discuss.elastic.co/t/behavior-of-scrolling-search-with-from-parameter-in-newer-es-versions/21739/4 "2015-01-21T14:03:47Z")

</div>

I agree, this should be fixed:

> <https://github.com/elastic/elasticsearch/issues/9373>
>
> During merging of the shard top doc results the from is ignored, while it can be… taken into account during the first scroll search request.
> 
> From the user list: https://groups.google.com/forum/?utm\_source=footer#!msg/elasticsearch/FS1qGg\_-JK8/byKMykzwFNkJ

On 21 January 2015 at 14:27, Gordon Tillman [gordyt@gmail.com](mailto:gordyt@gmail.com) wrote:

> Thanks Martijn,
> 
> That is what I have observed. But is is a regression from ES version  
> 1.0.1 and before. And I can't find anything that even implies that `from`  
> is not supported for a scroll search, except of course when  
> `search_type=scan`.
> 
> I would love to get support for that back into the product.
> 
> --g
> 
> On Wednesday, January 21, 2015 at 2:57:29 AM UTC-6, Martijn v Groningen  
> wrote:
> 
> > Hi Gordon,
> > 
> > This `from` is kind of ignored for scroll search. I don't remember why  
> > that was the case, but it seems to me that scroll search can/should take  
> > into account the `from` option during the first scroll search request.
> > 
> > Martijn
> > 
> > On 20 January 2015 at 23:33, Gordon Tillman [gor...@gmail.com](mailto:gor...@gmail.com) wrote:
> > 
> > > Greetings All,
> > > 
> > > I ran into an interesting issue when upgrading from ES version 1.0.1 to  
> > > newer versions. In particular, I tested the following with versions 1.2.4,  
> > > 1.3.4 and 1.4.2.
> > > 
> > > _summary_
> > > 
> > > When doing a normal scroll search (not one with a _search\_type=scan_),  
> > > it appears that the "from" parameter is being ignored.
> > > 
> > > _example 1 (no scrolling, result is correct)_
> > > 
> > > In this simplified example, only one document matches the supplied  
> > > query, so with _from=1_ no documents are returned.
> > > 
> > > curl localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:  
> > > c10ed0583104036a94e110f0a8b5fd7d4&from=1
> > > 
> > > _example 2 (with scrolling, incorrect result)_
> > > 
> > > In this example, where we specify the same query and from parameters,  
> > > but also specify a scroll parameter, we incorrectly get the single document  
> > > returned from the query.
> > > 
> > > curl localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:  
> > > c10ed0583104036a94e110f0a8b5fd7d4&from=1&scroll=2s | json
> > > 
> > > _notes_
> > > 
> > > 1. Both of the above test cases work correctly in version 1.0.1
> > > 2. In newer versions (where example 2 fails), I noticed that the  
> > > _from_ value is not present in the data that was returned from the  
> > > query.
> > > 
> > > I understand with with a \*search\_type=scan, \*this would be expected  
> > > because sorting is disabled. Also, please note this is a greatly  
> > > simplified query just for illustration purposes. I've attached a sample of  
> > > an actual query at the bottom of this post, and _it does contain  
> > > sorting specifications_.
> > > 
> > > Is this a known issue or is this being done by design in the newer ES  
> > > versions. A quick scan through the release notes was unrevealing.
> > > 
> > > Many thanks for any insight!
> > > 
> > > --g
> > > 
> > > _sample of full query_
> > > 
> > > {  
> > > "sort": [  
> > > {  
> > > "\_type": {  
> > > "order": "asc",  
> > > "ignore\_unmapped": true  
> > > }  
> > > },  
> > > {  
> > > "name\_lower": {  
> > > "order": "asc",  
> > > "ignore\_unmapped": true  
> > > }  
> > > },  
> > > {  
> > > "dds\_key": {  
> > > "order": "asc",  
> > > "ignore\_unmapped": true  
> > > }  
> > > }  
> > > ],  
> > > "query": {  
> > > "filtered": {  
> > > "filter": {  
> > > "and": [  
> > > {  
> > > "or": [  
> > > {  
> > > "term": {  
> > > "parent": "  
> > > c10ed0583104012f94e11ad0ac36f2aaf"  
> > > }  
> > > }  
> > > ]  
> > > },  
> > > {  
> > > "not": {  
> > > "term": {  
> > > "vcn": "DeleteMarker"  
> > > }  
> > > }  
> > > },  
> > > {  
> > > "not": {  
> > > "exists": {  
> > > "field": "notfinalized"  
> > > }  
> > > }  
> > > }  
> > > ]  
> > > },  
> > > "query": {  
> > > "match\_all": {}  
> > > }  
> > > }  
> > > },  
> > > "from": 1,  
> > > "size": 1000  
> > > }
> > > 
> > > --  
> > > 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).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > Met vriendelijke groet,
> > 
> > Martijn van Groningen

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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/CA%2BA76Tx2LjHcxMjmgo5wbFLxUYrzKR2\_eHO%2B9vpCV6KGvmKZDA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BA76Tx2LjHcxMjmgo5wbFLxUYrzKR2_eHO%2B9vpCV6KGvmKZDA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Gordon\_Tillman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gordon_tillman/32/984_2.png) [@Gordon\_Tillman](https://discuss.elastic.co/u/Gordon_Tillman)
#### Post date: [January 21, 2015, 2:08pm UTC](https://discuss.elastic.co/t/behavior-of-scrolling-search-with-from-parameter-in-newer-es-versions/21739/5 "2015-01-21T14:08:33Z")

</div>

Thank you Martijn!

On Wednesday, January 21, 2015 at 8:04:23 AM UTC-6, Martijn v Groningen  
wrote:

> I agree, this should be fixed:  
> [Scroll requests with `from` should throw an exception · Issue #9373 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/9373)
> 
> On 21 January 2015 at 14:27, Gordon Tillman \<[gor...@gmail.com](mailto:gor...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Thanks Martijn,
> > 
> > That is what I have observed. But is is a regression from ES version  
> > 1.0.1 and before. And I can't find anything that even implies that `from`  
> > is not supported for a scroll search, except of course when  
> > `search_type=scan`.
> > 
> > I would love to get support for that back into the product.
> > 
> > --g
> > 
> > On Wednesday, January 21, 2015 at 2:57:29 AM UTC-6, Martijn v Groningen  
> > wrote:
> > 
> > > Hi Gordon,
> > > 
> > > This `from` is kind of ignored for scroll search. I don't remember why  
> > > that was the case, but it seems to me that scroll search can/should take  
> > > into account the `from` option during the first scroll search request.
> > > 
> > > Martijn
> > > 
> > > On 20 January 2015 at 23:33, Gordon Tillman [gor...@gmail.com](mailto:gor...@gmail.com) wrote:
> > > 
> > > > Greetings All,
> > > > 
> > > > I ran into an interesting issue when upgrading from ES version 1.0.1 to  
> > > > newer versions. In particular, I tested the following with versions 1.2.4,  
> > > > 1.3.4 and 1.4.2.
> > > > 
> > > > _summary_
> > > > 
> > > > When doing a normal scroll search (not one with a _search\_type=scan_),  
> > > > it appears that the "from" parameter is being ignored.
> > > > 
> > > > _example 1 (no scrolling, result is correct)_
> > > > 
> > > > In this simplified example, only one document matches the supplied  
> > > > query, so with _from=1_ no documents are returned.
> > > > 
> > > > curl localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:  
> > > > c10ed0583104036a94e110f0a8b5fd7d4&from=1
> > > > 
> > > > _example 2 (with scrolling, incorrect result)_
> > > > 
> > > > In this example, where we specify the same query and from parameters,  
> > > > but also specify a scroll parameter, we incorrectly get the single document  
> > > > returned from the query.
> > > > 
> > > > curl localhost:9200/hm-community-alias/FileInfo/\_search?q=parents:  
> > > > c10ed0583104036a94e110f0a8b5fd7d4&from=1&scroll=2s | json
> > > > 
> > > > _notes_
> > > > 
> > > > 1. Both of the above test cases work correctly in version 1.0.1
> > > > 2. In newer versions (where example 2 fails), I noticed that the  
> > > > _from_ value is not present in the data that was returned from the  
> > > > query.
> > > > 
> > > > I understand with with a \*search\_type=scan, \*this would be expected  
> > > > because sorting is disabled. Also, please note this is a greatly  
> > > > simplified query just for illustration purposes. I've attached a sample of  
> > > > an actual query at the bottom of this post, and _it does contain  
> > > > sorting specifications_.
> > > > 
> > > > Is this a known issue or is this being done by design in the newer ES  
> > > > versions. A quick scan through the release notes was unrevealing.
> > > > 
> > > > Many thanks for any insight!
> > > > 
> > > > --g
> > > > 
> > > > _sample of full query_
> > > > 
> > > > {  
> > > > "sort": [  
> > > > {  
> > > > "\_type": {  
> > > > "order": "asc",  
> > > > "ignore\_unmapped": true  
> > > > }  
> > > > },  
> > > > {  
> > > > "name\_lower": {  
> > > > "order": "asc",  
> > > > "ignore\_unmapped": true  
> > > > }  
> > > > },  
> > > > {  
> > > > "dds\_key": {  
> > > > "order": "asc",  
> > > > "ignore\_unmapped": true  
> > > > }  
> > > > }  
> > > > ],  
> > > > "query": {  
> > > > "filtered": {  
> > > > "filter": {  
> > > > "and": [  
> > > > {  
> > > > "or": [  
> > > > {  
> > > > "term": {  
> > > > "parent": "  
> > > > c10ed0583104012f94e11ad0ac36f2aaf"  
> > > > }  
> > > > }  
> > > > ]  
> > > > },  
> > > > {  
> > > > "not": {  
> > > > "term": {  
> > > > "vcn": "DeleteMarker"  
> > > > }  
> > > > }  
> > > > },  
> > > > {  
> > > > "not": {  
> > > > "exists": {  
> > > > "field": "notfinalized"  
> > > > }  
> > > > }  
> > > > }  
> > > > ]  
> > > > },  
> > > > "query": {  
> > > > "match\_all": {}  
> > > > }  
> > > > }  
> > > > },  
> > > > "from": 1,  
> > > > "size": 1000  
> > > > }
> > > > 
> > > > --  
> > > > 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).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/ce8145ac-59c6-4a22-b4c4-eacb90281c4d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > Met vriendelijke groet,
> > > 
> > > Martijn van Groningen
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen

--  
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/c6ce78f2-cfe1-43e6-b759-2cb658881d99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c6ce78f2-cfe1-43e6-b759-2cb658881d99%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/behavior-of-scrolling-search-with-from-parameter-in-newer-es-versions/21739/6 "2017-07-06T00:37:34Z")

</div>


