ElasticsearchQueryHelper { public static void boolAddShould(JsonObject bool, JsonObject should) { boolAdd(bool, should, "should"); } private  ElasticsearchQueryHelper(); static JsonObject boolQuery(); static JsonObject boolQuery(int minimumShouldMatch); static void boolAddFilter(JsonObject bool, JsonObject filter); static void boolAddMust(JsonObject bool, JsonObject must); static void boolAddMustNot(JsonObject bool, JsonObject mustNot); static void boolAddShould(JsonObject bool, JsonObject should); static JsonObject termQuery(String name, Object value); static JsonObject ltQuery(String name, Object value); static JsonObject lteQuery(String name, Object value); static JsonObject gtQuery(String name, Object value); static JsonObject gteQuery(String name, Object value); static JsonObject matchAllQuery(); static JsonObject multiMatchQuery(Object text, String... fieldNames); static JsonObject existsQuery(String name); static JsonObject prefixQuery(String name, Object prefix); static JsonObject geoShapeQuery(String name, JsonObject shape, String relation); static JsonObject shape(String type, JsonArray coordinates);  }
@Test public void testBoolAddShould() { JsonObject s = new JsonObject() .put("term", new JsonObject() .put("tags", "Fraunhofer IGD")); JsonObject q = boolQuery(); boolAddShould(q, s); JsonObject expected = new JsonObject() .put("bool", new JsonObject() .put("should", s)); assertEquals(expected, q); }