# SearchType SCAN and Size

**URL:** <https://discuss.elastic.co/t/searchtype-scan-and-size/14574>\
**Category:** Elasticsearch\
**Created:** [November 25, 2013, 10:48am UTC](https://discuss.elastic.co/t/searchtype-scan-and-size/14574 "2013-11-25T10:48:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Kley](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Alexander\_Kley](https://discuss.elastic.co/u/Alexander_Kley)\
**Post date:** [November 25, 2013, 10:48am UTC](https://discuss.elastic.co/t/searchtype-scan-and-size/14574/1 "2013-11-25T10:48:24Z")

</div>

Hi guys,

If I scroll over scanned search response, the size of the initial search  
request will be ignored?

initial SearchRequest to get scroll ID:  
client.prepareSearch(index).setSearchType(SearchType.SCAN).setScroll(TimeValue.timeValueSeconds(keepTimeInSeconds  
\<= 0 ? 300 : keepTimeInSeconds)).setSize(50);

ScrolledSearchRequest  
client.prepareSearchScroll(scrollId).setScroll(TimeValue.timeValueMinutes(keepTimeInMinutes)).get();

The scrolling works fine, but hits per fetch are not 50!

When I create 1000 documents, I thought there are 20 loops until whole  
request is finished? But scrolling search request builds pages with 9 x100  
docs , than 78 then 12.  
Log:  
Progress .... 100/1000  
Progress .... 200/1000  
Progress .... 300/1000  
Progress .... 400/1000  
Progress .... 500/1000  
Progress .... 600/1000  
Progress .... 700/1000  
Progress .... 800/1000  
Progress .... 900/1000  
Progress .... 978/1000  
Progress .... 1000/1000

I'm confused about size_primShards = pagesize. I have 5 prim. shards. But  
50_5 are not 100! Whats wrong on my side?

Best regards  
Alex

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Alexander\_Kley](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Alexander\_Kley](https://discuss.elastic.co/u/Alexander_Kley)\
**Post date:** [November 25, 2013, 12:07pm UTC](https://discuss.elastic.co/t/searchtype-scan-and-size/14574/2 "2013-11-25T12:07:34Z")

</div>

Without searchType SCAN the size works fine during scrolling. Is it right?

--  
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).  
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:05am UTC](https://discuss.elastic.co/t/searchtype-scan-and-size/14574/3 "2017-07-06T02:05:00Z")

</div>


