Thanks Alex. I have done it like this:

while (true) {
    scrollResp = 
*client.prepareSearchScroll(scrollResp.getScrollId()).setScroll(new 
TimeValue(600000)).execute().actionGet();*
    SearchHits sh= scrollResp.getHits();
    SearchHit[] searchHit = sh.getHits();
  
LOG.info("Hits :"+sh.getTotalHits()+", Docs fetched :"+searchHit.length);
    if (scrollResp.getHits().getHits().length == 0) {
        break;
    }
}

So assuming I have only on shard and i am fetching total of 100,000 
documents in steps of 10,000 documents then there will be 10 get calls and 
this call will happen serially one after the other. Is there a mechanism by 
any chance to execute this get calls in parallel.

On Wednesday, October 15, 2014 11:53:38 PM UTC+5:30, Alexandre Rafalovitch 
wrote:
>
> Have you looked at Scroll and Scan? 
>
> http://www.elasticsearch.org/guide/en/elasticsearch/guide/master/scan-scroll.html
>  
>
> This assumes your _source field has not been disabled. 
>
> Regards, 
>    Alex. 
> Personal: http://www.outerthoughts.com/ and @arafalov 
> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart 
> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853 
>
>
> On 15 October 2014 13:14, Vijay Tiwary <[email protected] <javascript:>> 
> wrote: 
> > Is there a easy way to export a some part of data(based on some filters) 
> > from a index say for e.g from a master index to a new index. Apparently 
> it 
> > looks like I will have to use bulk API to query the data from the master 
> > index (using some filters) and then  I will have insert those documents 
> into 
> > the new index. Is there any better and easier way. 
> > 
> > -- 
> > 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 [email protected] <javascript:>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/elasticsearch/f3778121-8019-44ba-a30c-3194ae72f72f%40googlegroups.com.
>  
>
> > For more options, visit 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/5bce72bf-3400-4963-9fa7-adf48d12383d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to