BAEL-2958: Add search example
This commit is contained in:
parent
ab8684f916
commit
53f3f903ce
|
@ -101,6 +101,16 @@ public class JestDemoApplication {
|
||||||
jestClient.execute(new Get.Builder("employees", "1").build());
|
jestClient.execute(new Get.Builder("employees", "1").build());
|
||||||
|
|
||||||
// Search documents
|
// 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
|
// Update document
|
||||||
employee.setYears_of_service(3);
|
employee.setYears_of_service(3);
|
||||||
|
|
Loading…
Reference in New Issue