Search in sources :

Example 1 with SpanGapQuery

use of org.opensearch.client.opensearch._types.query_dsl.SpanGapQuery in project opensearch-java by opensearch-project.

the class BuiltinTypesTest method testSpanGapQuery.

@Test
public void testSpanGapQuery() {
    // Hand-written class
    SpanGapQuery q = SpanGapQuery.of(b -> b.field("a-field").spanWidth(12));
    q = checkJsonRoundtrip(q, "{\"a-field\":12}");
    assertEquals("a-field", q.field());
    assertEquals(12, q.spanWidth());
}
Also used : SpanGapQuery(org.opensearch.client.opensearch._types.query_dsl.SpanGapQuery) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 SpanGapQuery (org.opensearch.client.opensearch._types.query_dsl.SpanGapQuery)1