use of org.opensearch.client.opensearch._types.query_dsl.ShapeQuery in project opensearch-java by opensearch-project.
the class BehaviorsTest method testAdditionalPropertyOnClass.
@Test
public void testAdditionalPropertyOnClass() {
ShapeQuery q = new ShapeQuery.Builder().queryName("query-name").field("field-name").shape(_0 -> _0.relation(GeoShapeRelation.Disjoint)).ignoreUnmapped(true).build();
q = checkJsonRoundtrip(q, "{\"field-name\":{\"relation\":\"disjoint\"},\"_name\":\"query-name\",\"ignore_unmapped\":true}");
assertEquals("query-name", q.queryName());
assertTrue(q.ignoreUnmapped());
assertEquals(GeoShapeRelation.Disjoint, q.shape().relation());
System.out.println(toJson(q));
}
Aggregations