Package org.elasticsearch.action.search

Examples of org.elasticsearch.action.search.SearchResponse.scrollId()


                .setScroll(TimeValue.timeValueMinutes(2))
                .execute().actionGet();
        logger.info("Verifying versions for {} hits...", searchResponse.hits().totalHits());

        while (true) {
            searchResponse = client.client().prepareSearchScroll(searchResponse.scrollId()).setScroll(TimeValue.timeValueMinutes(2)).execute().actionGet();
            if (searchResponse.failedShards() > 0) {
                logger.warn("Search Failures " + Arrays.toString(searchResponse.shardFailures()));
            }
            for (SearchHit hit : searchResponse.hits()) {
                long version = -1;
View Full Code Here


//            System.out.println(hit.shard() + ": " + hit.score() + ":" +  hit.explanation());
            assertThat(hit.explanation(), notNullValue());
            assertThat("id[" + hit.id() + "]", hit.id(), equalTo(Integer.toString(100 - i - 1)));
        }

        searchResponse = client.searchScroll(searchScrollRequest(searchResponse.scrollId())).actionGet();

        assertThat(searchResponse.hits().totalHits(), equalTo(100l));
        assertThat(searchResponse.hits().hits().length, equalTo(40));
        for (int i = 0; i < 40; i++) {
            SearchHit hit = searchResponse.hits().hits()[i];
View Full Code Here

//            System.out.println(hit.shard() + ": " +  hit.explanation());
            assertThat(hit.explanation(), notNullValue());
            assertThat("id[" + hit.id() + "]", hit.id(), equalTo(Integer.toString(i)));
        }

        searchResponse = client.searchScroll(searchScrollRequest(searchResponse.scrollId())).actionGet();

        assertThat(searchResponse.hits().totalHits(), equalTo(100l));
        assertThat(searchResponse.hits().hits().length, equalTo(40));
        for (int i = 0; i < 40; i++) {
            SearchHit hit = searchResponse.hits().hits()[i];
View Full Code Here

        assertThat(searchResponse.hits().hits().length, equalTo(35));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(((Number) hit.sortValues()[0]).longValue(), equalTo(counter++));
        }

        searchResponse = client.prepareSearchScroll(searchResponse.scrollId())
                .setScroll(TimeValue.timeValueMinutes(2))
                .execute().actionGet();

        assertThat(searchResponse.hits().getTotalHits(), equalTo(100l));
        assertThat(searchResponse.hits().hits().length, equalTo(35));
View Full Code Here

//            System.out.println(hit.shard() + ": " +  hit.explanation());
            assertThat(hit.explanation(), notNullValue());
            assertThat("id[" + hit.id() + "]", hit.id(), equalTo(Integer.toString(100 - i - 1)));
        }

        searchResponse = client.searchScroll(searchScrollRequest(searchResponse.scrollId())).actionGet();

        assertThat(searchResponse.hits().totalHits(), equalTo(100l));
        assertThat(searchResponse.hits().hits().length, equalTo(40));
        for (int i = 0; i < 40; i++) {
            SearchHit hit = searchResponse.hits().hits()[i];
View Full Code Here

//            System.out.println(hit.shard() + ": " +  hit.explanation());
            assertThat(hit.explanation(), notNullValue());
            assertThat("id[" + hit.id() + "]", hit.id(), equalTo(Integer.toString(i)));
        }

        searchResponse = client.searchScroll(searchScrollRequest(searchResponse.scrollId())).actionGet();

        assertThat(searchResponse.hits().totalHits(), equalTo(100l));
        assertThat(searchResponse.hits().hits().length, equalTo(40));
        for (int i = 0; i < 40; i++) {
            SearchHit hit = searchResponse.hits().hits()[i];
View Full Code Here

            // we can't really check here, since its query and fetch, and not controlling distribution
//            assertThat("id[" + hit.id() + "]", hit.id(), equalTo(Integer.toString(100 - i - 1)));
            assertThat("make sure we don't have duplicates", expectedIds.remove(hit.id()), notNullValue());
        }

        searchResponse = client.searchScroll(searchScrollRequest(searchResponse.scrollId())).actionGet();

        assertThat(searchResponse.hits().totalHits(), equalTo(100l));
        assertThat(searchResponse.hits().hits().length, equalTo(40));
        for (int i = 0; i < 40; i++) {
            SearchHit hit = searchResponse.hits().hits()[i];
View Full Code Here

            assertThat(hit.explanation(), notNullValue());
//            assertThat("id[" + hit.id() + "]", hit.id(), equalTo(Integer.toString(100 - i - 1)));
            assertThat("make sure we don't have duplicates", expectedIds.remove(hit.id()), notNullValue());
        }

        searchResponse = client.searchScroll(searchScrollRequest(searchResponse.scrollId())).actionGet();

        assertThat(searchResponse.hits().totalHits(), equalTo(100l));
        assertThat(searchResponse.hits().hits().length, equalTo(40));
        for (int i = 0; i < 40; i++) {
            SearchHit hit = searchResponse.hits().hits()[i];
View Full Code Here

        assertThat(searchResponse.hits().hits().length, equalTo(35));
        for (SearchHit hit : searchResponse.hits()) {
            assertThat(((Number) hit.sortValues()[0]).longValue(), equalTo(counter++));
        }

        searchResponse = client.prepareSearchScroll(searchResponse.scrollId())
                .setScroll(TimeValue.timeValueMinutes(2))
                .execute().actionGet();

        assertThat(searchResponse.hits().getTotalHits(), equalTo(100l));
        assertThat(searchResponse.hits().hits().length, equalTo(30));
View Full Code Here

        for (SearchHit hit : searchResponse.hits()) {
            assertThat(((Number) hit.sortValues()[0]).longValue(), equalTo(counter++));
        }

        for (int i = 0; i < 32; i++) {
            searchResponse = client.prepareSearchScroll(searchResponse.scrollId())
                    .setScroll(TimeValue.timeValueMinutes(2))
                    .execute().actionGet();

            assertThat(searchResponse.hits().getTotalHits(), equalTo(100l));
            assertThat(searchResponse.hits().hits().length, equalTo(3));
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.