Examples of totalShards()


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

        assertThat(refreshResponse.successfulShards(), equalTo(3));
        assertThat(refreshResponse.failedShards(), equalTo(0));
        for (int i = 0; i < 5; i++) {
            try {
                SearchResponse searchResponse = client("server1").search(searchRequest("test").source(Unicode.fromStringAsBytes("{ xxx }"))).actionGet();
                assertThat(searchResponse.totalShards(), equalTo(3));
                assertThat(searchResponse.successfulShards(), equalTo(0));
                assertThat(searchResponse.failedShards(), equalTo(3));
                assert false : "search should fail";
            } catch (ElasticSearchException e) {
                assertThat(e.unwrapCause(), instanceOf(SearchPhaseExecutionException.class));
View Full Code Here

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

        assertThat(refreshResponse.failedShards(), equalTo(0));

        for (int i = 0; i < 5; i++) {
            try {
                SearchResponse searchResponse = client("server1").search(searchRequest("test").source(Unicode.fromStringAsBytes("{ xxx }"))).actionGet();
                assertThat(searchResponse.totalShards(), equalTo(3));
                assertThat(searchResponse.successfulShards(), equalTo(0));
                assertThat(searchResponse.failedShards(), equalTo(3));
                assert false : "search should fail";
            } catch (ElasticSearchException e) {
                assertThat(e.unwrapCause(), instanceOf(SearchPhaseExecutionException.class));
View Full Code Here

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

    @Test public void testFailedSearchWithWrongQuery() throws Exception {
        logger.info("Start Testing failed search with wrong query");
        try {
            SearchResponse searchResponse = client.search(searchRequest("test").source(Unicode.fromStringAsBytes("{ xxx }"))).actionGet();
            assertThat(searchResponse.totalShards(), equalTo(3));
            assertThat(searchResponse.successfulShards(), equalTo(0));
            assertThat(searchResponse.failedShards(), equalTo(3));
            assert false : "search should fail";
        } catch (ElasticSearchException e) {
            assertThat(e.unwrapCause(), instanceOf(SearchPhaseExecutionException.class));
View Full Code Here

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

        SearchSourceBuilder source = searchSource()
                .query(termQuery("multi", "test"))
                .from(1000).size(20).explain(true);
        SearchResponse response = client.search(searchRequest("test").searchType(DFS_QUERY_AND_FETCH).source(source)).actionGet();
        assertThat(response.hits().hits().length, equalTo(0));
        assertThat(response.totalShards(), equalTo(3));
        assertThat(response.successfulShards(), equalTo(3));
        assertThat(response.failedShards(), equalTo(0));

        response = client.search(searchRequest("test").searchType(QUERY_THEN_FETCH).source(source)).actionGet();
        assertThat(response.shardFailures().length, equalTo(0));
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.