BAEL-2958: Add search example

This commit is contained in:
Michael Pratt 2019-05-24 12:00:18 -06:00
parent ab8684f916
commit 53f3f903ce
1 changed files with 10 additions and 0 deletions

View File

@ -101,6 +101,16 @@ public class JestDemoApplication {
jestClient.execute(new Get.Builder("employees", "1").build());
// Search documents
String search = "{\n" +
" \"query\": {\n" +
" \"bool\": {\n" +
" \"must\": [\n" +
" { \"match\": { \"name\": \"Michael Pratt\" }}\n" +
" ]\n" +
" }\n" +
" }\n" +
"}";
jestClient.execute(new Search.Builder(search).build());
// Update document
employee.setYears_of_service(3);