public Void call() throws Exception {
cache1.remove("1"); // cache will now be out of sync with the index
searchManager = Search.getSearchManager(cache1);
Query query = createQueryBuilder().keyword().onField("bar").matching("1").createQuery();
ResultIterator iterator = searchManager.getQuery(query).projection(ProjectionConstants.VALUE, "bar")
.iterator(new FetchOptions().fetchMode(LAZY));
assertTrue("Expected an element in iterator.", iterator.hasNext());
Object[] projection = (Object[]) iterator.next();
assertNull(projection[0]);
assertEquals("1", projection[1]);
return null;
}
});