# Using scroll and different results sizes

**URL:** <https://discuss.elastic.co/t/using-scroll-and-different-results-sizes/22872>\
**Category:** Elasticsearch\
**Created:** [March 24, 2015, 8:04pm UTC](https://discuss.elastic.co/t/using-scroll-and-different-results-sizes/22872 "2015-03-24T20:04:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Todd\_Nine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/todd_nine/32/778_2.png) [@Todd\_Nine](https://discuss.elastic.co/u/Todd_Nine)\
**Post date:** [March 24, 2015, 8:04pm UTC](https://discuss.elastic.co/t/using-scroll-and-different-results-sizes/22872/1 "2015-03-24T20:04:07Z")

</div>

Hey all,  
We use ES as our indexing sub system. Our canonical record store is  
Cassandra. Due to the denormalization we perform for faster query speed,  
occasionally the state of documents in ES can lag behind the state of our  
Cassandra instance. To accommodate this eventually consist system, our  
query path is the following.

Query ES -\> returns scrollId and document ids-\> Load entities from  
Cassandra -\> Drop "stale" documents from results and asynchronously remove  
them.

If the user requested 10 entities, and only 8 were current, we will be  
missing 2 results and need to make another trip to ES to satisfy the result  
size. Is it possible to do the following?

//get first page with 10 results  
POST /testindex/mytype/\_search?scroll=1m {"from":0, "size": 10}

POST /testing/mytype/\_search?scroll\_id= {"size":2}

I always seem to get back 10 on my second request. If not other option is  
available, I'd rather truncate our result set size to \< the user's  
requested size than take the performance hit of using from and size to drop  
results. Our document counts can be 50million+, so I'm concerned with the  
performance implications of not using scroll.

Thoughts?

Thanks,  
Todd

--  
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/4a6cf1a9-9b96-47c2-a3f6-0955b3e74283%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4a6cf1a9-9b96-47c2-a3f6-0955b3e74283%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:24am UTC](https://discuss.elastic.co/t/using-scroll-and-different-results-sizes/22872/2 "2017-07-06T00:24:17Z")

</div>


