# Final request when scroll-scanning has 0 successful shards

**URL:** https://discuss.elastic.co/t/final-request-when-scroll-scanning-has-0-successful-shards/19065
**Category:** Elasticsearch
**Created:** [August 4, 2014, 10:54am UTC](https://discuss.elastic.co/t/final-request-when-scroll-scanning-has-0-successful-shards/19065 "2014-08-04T10:54:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tim\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tim_s/32/958_2.png) [@Tim\_S](https://discuss.elastic.co/u/Tim_S)
#### Post date: [August 4, 2014, 10:54am UTC](https://discuss.elastic.co/t/final-request-when-scroll-scanning-has-0-successful-shards/19065/1 "2014-08-04T10:54:46Z")

</div>

When scroll-scanning  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html#scroll-scan](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html#scroll-scan),  
I keep scrolling until I get a result that returns 0 docs, which is what  
the docs seem to suggest that I should do.

But the final request (the one that returns 0 docs), always has  
\_shards.successful=0. Normally, I’d consider this to indicate a failure (no  
shards responded). If doing a normal (non-scan) scroll, \_shards.successful=1  
(I’ve got 1 shard in this case), even when I’ve got to the point where  
there’s no more docs to scroll.

Is this a bug in the scanning? Or am I wrong to consider the  
\_shards.successful=0 to indicate a failure?

Tested on version 1.3.1.

--  
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/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [August 4, 2014, 11:26am UTC](https://discuss.elastic.co/t/final-request-when-scroll-scanning-has-0-successful-shards/19065/2 "2014-08-04T11:26:27Z")

</div>

This is correct. On the last request, no hits are returned because all  
shards have already been drained of results. If you look at shards.total  
and shards.failed, you'll see they are also 0

clint

On 4 August 2014 12:54, Tim S [timstibbs@gmail.com](mailto:timstibbs@gmail.com) wrote:

> When scroll-scanning  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html#scroll-scan](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html#scroll-scan),  
> I keep scrolling until I get a result that returns 0 docs, which is what  
> the docs seem to suggest that I should do.
> 
> But the final request (the one that returns 0 docs), always has  
> \_shards.successful=0. Normally, I’d consider this to indicate a failure  
> (no shards responded). If doing a normal (non-scan) scroll,  
> \_shards.successful=1 (I’ve got 1 shard in this case), even when I’ve got  
> to the point where there’s no more docs to scroll.
> 
> Is this a bug in the scanning? Or am I wrong to consider the  
> \_shards.successful=0 to indicate a failure?
> 
> Tested on version 1.3.1.
> 
> --  
> 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/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAPt3XKQLaJAVtwvOgScGhr-inoT8KpG9k3\_Q%2BpCvNetX%3DcpMNQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPt3XKQLaJAVtwvOgScGhr-inoT8KpG9k3_Q%2BpCvNetX%3DcpMNQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Tim\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tim_s/32/958_2.png) [@Tim\_S](https://discuss.elastic.co/u/Tim_S)
#### Post date: [August 4, 2014, 11:41am UTC](https://discuss.elastic.co/t/final-request-when-scroll-scanning-has-0-successful-shards/19065/3 "2014-08-04T11:41:54Z")

</div>

Yes, it makes sense in this case, it's just confusing because it happens  
differently in other situations - when doing a normal scroll (not  
scanning), shards.successful is non-zero even when you've reached the point  
where there's no more results (and even if you keep going). And if you do a  
search returning no results, shards.successful is also non-zero.

So, should I ever (not just when scrolling) consider shards.successful=0 to  
indicate a failure? Or should I ignore it and only look at the  
shards.failed?

On Monday, August 4, 2014 12:27:22 PM UTC+1, Clinton Gormley wrote:

> This is correct. On the last request, no hits are returned because all  
> shards have already been drained of results. If you look at shards.total  
> and shards.failed, you'll see they are also 0
> 
> clint
> 
> On 4 August 2014 12:54, Tim S \<[tims...@gmail.com](mailto:tims...@gmail.com) \<javascript:\>\> wrote:
> 
> > When scroll-scanning  
> > [http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html#scroll-scan](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html#scroll-scan),  
> > I keep scrolling until I get a result that returns 0 docs, which is what  
> > the docs seem to suggest that I should do.
> > 
> > But the final request (the one that returns 0 docs), always has  
> > \_shards.successful=0. Normally, I’d consider this to indicate a failure  
> > (no shards responded). If doing a normal (non-scan) scroll,  
> > \_shards.successful=1 (I’ve got 1 shard in this case), even when I’ve got  
> > to the point where there’s no more docs to scroll.
> > 
> > Is this a bug in the scanning? Or am I wrong to consider the  
> > \_shards.successful=0 to indicate a failure?
> > 
> > Tested on version 1.3.1.
> > 
> > --  
> > 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/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/3998b393-476d-4fc4-a809-a15da19bdf8d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/03dc5c45-01e3-4d1e-a23c-830a26ef4f3b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/03dc5c45-01e3-4d1e-a23c-830a26ef4f3b%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, 1:11am UTC](https://discuss.elastic.co/t/final-request-when-scroll-scanning-has-0-successful-shards/19065/4 "2017-07-06T01:11:04Z")

</div>


