AssertJUnit.assertTrue(foundWithLowerThreshold.contains(person2));
}
public void testQueryingRangeWithAnd() {
NumericType type1 = new NumericType(10, 20);
NumericType type2 = new NumericType(20, 10);
NumericType type3 = new NumericType(10, 10);
cache.put(key1, type1);
cache.put(key2, type2);
cache.put(key3, type3);
Query query = Search.getSearchManager(cache).buildQueryBuilderForClass(NumericType.class)
.get().range().onField("num1").andField("num2").below(20).excludeLimit().createQuery();
CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(query);
List<Object> found = cacheQuery.list();
AssertJUnit.assertEquals(3, found.size()); //<------ All entries should be here, because andField is executed as SHOULD;
assert found.contains(type1);
assert found.contains(type2);
assert found.contains(type3);
NumericType type4 = new NumericType(11, 10);
cache.put("newKey", type4);
cacheQuery = Search.getSearchManager(cache).getQuery(query);
found = cacheQuery.list();