Package org.elasticsearch.client.transport

Examples of org.elasticsearch.client.transport.TransportClient.prepareSearch()


            GetResponse getResponse = client.prepareGet("test", "test", randomId).get();
            assertThat(getResponse.isExists(), equalTo(true));

            refresh();

            SearchResponse searchResponse = client.prepareSearch("test").get();
            assertThat(searchResponse.getHits().totalHits(), equalTo((long)numDocs));

            int randomDocId = randomInt(numDocs-1);
            String fieldValue = "value" + randomDocId;
            String id = "id" + randomDocId;
View Full Code Here


            assertThat(searchResponse.getHits().totalHits(), equalTo((long)numDocs));

            int randomDocId = randomInt(numDocs-1);
            String fieldValue = "value" + randomDocId;
            String id = "id" + randomDocId;
            searchResponse = client.prepareSearch("test").setQuery(QueryBuilders.termQuery("field", fieldValue)).get();
            assertSearchHits(searchResponse, id);
        }
    }
}
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.