use of org.opensearch.client.opensearch._types.query_dsl.TermQuery in project opensearch-java by opensearch-project.
the class BehaviorsTest method testSingleKeyDictionary.
@Test
public void testSingleKeyDictionary() {
TermQuery q = new TermQuery.Builder().queryName("query-name").field("field-name").value(FieldValue.of("some-value")).build();
q = checkJsonRoundtrip(q, "{\"field-name\":{\"_name\":\"query-name\",\"value\":\"some-value\"}}");
assertEquals("query-name", q.queryName());
assertEquals("field-name", q.field());
assertEquals("some-value", q.value().stringValue());
}
Aggregations