if (hasIndex) {
QueryContext queryContext = new QueryContext(this);
if (predicate instanceof IndexAwarePredicate) {
IndexAwarePredicate iap = (IndexAwarePredicate) predicate;
if (iap.isIndexed(queryContext)) {
return iap.filter(queryContext);
}
}
}
return null;
}