use of com.enonic.xp.repo.impl.elasticsearch.query.translator.resolver.SearchQueryFieldNameResolver in project xp by enonic.
the class RangeExpressionBuilderTest method compare_gte_instant.
@Test
public void compare_gte_instant() throws Exception {
final String expected = load("compare_gt_datetime.json");
final QueryBuilder query = RangeExpressionBuilder.build(CompareExpr.gt(FieldExpr.from("myField"), ValueExpr.instant("2013-11-29T11:00:00.000Z")), new SearchQueryFieldNameResolver());
assertEquals(cleanString(expected), cleanString(query.toString()));
}
use of com.enonic.xp.repo.impl.elasticsearch.query.translator.resolver.SearchQueryFieldNameResolver in project xp by enonic.
the class InExpressionBuilderTest method compareInString.
@Test
public void compareInString() throws Exception {
final String expected = load("compare_in_string.json");
final QueryBuilder query = InExpressionBuilder.build(CompareExpr.in(FieldExpr.from("myField"), List.of(ValueExpr.string("myFirstValue"), ValueExpr.string("mySecondValue"))), new SearchQueryFieldNameResolver());
assertEquals(cleanString(expected), cleanString(query.toString()));
}
use of com.enonic.xp.repo.impl.elasticsearch.query.translator.resolver.SearchQueryFieldNameResolver in project xp by enonic.
the class TermExpressionBuilderTest method compare_eq_string.
@Test
public void compare_eq_string() throws Exception {
final String expected = load("compare_eq_string.json");
final QueryBuilder query = TermExpressionBuilder.build(CompareExpr.eq(FieldExpr.from("myField"), ValueExpr.string("myValue")), new SearchQueryFieldNameResolver());
assertEquals(cleanString(expected), cleanString(query.toString()));
}
Aggregations