diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchDocumentationIT.java index 8c900275a50d5..2bfe2c468bc1a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchDocumentationIT.java @@ -123,6 +123,7 @@ public void testSearch() throws IOException { SearchRequest searchRequest = new SearchRequest(); // <1> SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); // <2> searchSourceBuilder.query(QueryBuilders.matchAllQuery()); // <3> + searchRequest.source(searchSourceBuilder); // <4> // end::search-request-basic } { diff --git a/docs/java-rest/high-level/apis/search.asciidoc b/docs/java-rest/high-level/apis/search.asciidoc index de336fd60d8e4..5b42956d1194b 100644 --- a/docs/java-rest/high-level/apis/search.asciidoc +++ b/docs/java-rest/high-level/apis/search.asciidoc @@ -18,6 +18,7 @@ include-tagged::{doc-tests}/SearchDocumentationIT.java[search-request-basic] <1> Creates the `SeachRequest`. Without arguments this runs against all indices. <2> Most search parameters are added to the `SearchSourceBuilder`. It offers setters for everything that goes into the search request body. <3> Add a `match_all` query to the `SearchSourceBuilder`. +<4> Add the `SearchSourceBuilder` to the `SeachRequest`. ===== Optional arguments