use of com.enonic.xp.repo.impl.elasticsearch.query.translator.resolver.SearchQueryFieldNameResolver in project xp by enonic.
the class RangeExpressionBuilderTest method compare_lt_number.
@Test
public void compare_lt_number() throws Exception {
final String expected = load("compare_lt_number.json");
final QueryBuilder query = RangeExpressionBuilder.build(CompareExpr.lt(FieldExpr.from("myField"), ValueExpr.number(3L)), 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 RangeExpressionBuilderTest method compare_gt_number.
@Test
public void compare_gt_number() throws Exception {
final String expected = load("compare_gt_number.json");
final QueryBuilder query = RangeExpressionBuilder.build(CompareExpr.gt(FieldExpr.from("myField"), ValueExpr.number(3L)), 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 NotQueryBuilderTest method negate_term.
@Test
public void negate_term() throws Exception {
final String expected = load("not_term.json");
final CompareExpr compareExpr = CompareExpr.create(FieldExpr.from("fisk"), CompareExpr.Operator.EQ, ValueExpr.string("ost"));
final QueryBuilder query = NotQueryBuilder.build(CompareExpressionBuilder.build(compareExpr, 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_number.
@Test
public void compare_eq_number() throws Exception {
final String expected = load("compare_eq_number.json");
final QueryBuilder query = TermExpressionBuilder.build(CompareExpr.eq(FieldExpr.from("myField"), ValueExpr.number(1)), 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_geopoint.
@Test
public void compare_eq_geopoint() throws Exception {
final String expected = load("compare_eq_geopoint.json");
final QueryBuilder query = TermExpressionBuilder.build(CompareExpr.eq(FieldExpr.from("myField"), ValueExpr.geoPoint("59.9127300,10.746090")), new SearchQueryFieldNameResolver());
assertEquals(cleanString(expected), cleanString(query.toString()));
}
Aggregations