Skip to content

[Docs] REST high-level client: Fix code for most basic search request #28916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public void testSearch() throws Exception {
SearchRequest searchRequest = new SearchRequest(); // <1>
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); // <2>
searchSourceBuilder.query(QueryBuilders.matchAllQuery()); // <3>
searchRequest.source(searchSourceBuilder); // <4>
// end::search-request-basic
}
{
Expand Down
1 change: 1 addition & 0 deletions docs/java-rest/high-level/search/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down