# Slow get data

**URL:** <https://discuss.elastic.co/t/slow-get-data/115656>\
**Category:** Elasticsearch\
**Created:** [January 16, 2018, 7:43am UTC](https://discuss.elastic.co/t/slow-get-data/115656 "2018-01-16T07:43:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tony27](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tony27](https://discuss.elastic.co/u/tony27)\
**Post date:** [January 16, 2018, 7:43am UTC](https://discuss.elastic.co/t/slow-get-data/115656/1 "2018-01-16T07:43:47Z")

</div>

hey, im try get 4500 data, but very slow 7second to complete.  
im using slice scroll .  
this my code

```
    	      int slices = 5;		
            		SearchSourceBuilder searchSourceBuilder = SearchSourceBuilder.searchSource();
            		IntStream.range(0, slices).parallel().forEach(i -> {
            			SliceBuilder sliceBuilder = new SliceBuilder(i, slices);
            			SearchResponse response = client.prepareSearch("twitter_timeline_v1").setTypes("twitter_timeline")
            					.setSource(searchSourceBuilder)
            					.setScroll(new TimeValue(60000))
            					.slice(sliceBuilder)
            					.setFrom(0)
            					.setSize(1000)
            					.setQuery(qb)
            					.setExplain(false)
            					.get();
        do {
        			for (SearchHit responses : response.getHits()) {

        				List<String> tes1 = (List<String>) responses.getSource().get("tweet");
        				count.addAll(tes1);			
        			}			
        			 response = client.prepareSearchScroll(response.getScrollId()).setScroll(new TimeValue(60000)).execute().actionGet();		
        			}
        		while(response.getHits().getHits().length !=0);	
        		});`

```

{  
"state": "open",  
"settings": {  
"index": {  
"creation\_date": "1512717534505",  
"number\_of\_shards": "5",  
"number\_of\_replicas": "1",  
"uuid": "85bJTl\_UTsOWyMNKTLXxAw",  
"version": {  
"created": "5000005"  
}  
}  
}

any solution?

thanks

---

<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:** [February 13, 2018, 7:44am UTC](https://discuss.elastic.co/t/slow-get-data/115656/2 "2018-02-13T07:44:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
