Package org.elasticsearch.client

Examples of org.elasticsearch.client.Client.prepareSearchScroll()


        if (! commandLineOptions.isFix()) {
            LOG.warn("Not executing update because '-F' command line flag not given!");
        }

        while (true) {
            final SearchResponse r = client.prepareSearchScroll(response.getScrollId()).setScroll(TimeValue.timeValueMinutes(1)).execute().actionGet();

            if (r.getHits().getHits().length == 0) {
                LOG.debug("No more hits, done!");
                break;
            }
View Full Code Here


        String scrollId = searchResponse.getScrollId();
        int scrollRequestCounter = 0;
        long sumTimeSpent = 0;
        while (true) {
            long timeSpent = System.currentTimeMillis();
            searchResponse = client.prepareSearchScroll(scrollId).setScroll("10m").get();
            sumTimeSpent += (System.currentTimeMillis() - timeSpent);
            scrollRequestCounter++;
            if (searchResponse.getHits().getTotalHits() != numDocs) {
                System.err.printf(Locale.ENGLISH, "Expected total hits [%d] but got [%d]\n", numDocs, searchResponse.getHits().getTotalHits());
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.