switch (predicate) { case "geoIntersect": return Geo.geoIntersect(value); case "geoDisjoint": return Geo.geoDisjoint(value); case "geoWithin": return Geo.geoWithin(value); case "geoContains": return Geo.geoContains(value); case "textContains": return Text.textContains(value);
public Map<String,Object> geoShape(String key, Map<String,Object> geoShape, Geo predicate) { final String relation = predicate == Geo.INTERSECT ? "intersects" : predicate.name().toLowerCase(); return filter(ImmutableMap.of("geo_shape", ImmutableMap.of(key, ImmutableMap.of("shape", geoShape, "relation", relation)))); }