Map<String, NodeType> selectorMap,
JackrabbitIndexSearcher searcher, IndexReader reader)
throws RepositoryException, IOException {
Predicate filter = Predicate.TRUE;
if (constraint instanceof And) {
And and = (And) constraint;
filter = mapConstraintToQueryAndFilter(
query, and.getConstraint1(), selectorMap, searcher, reader);
Predicate other = mapConstraintToQueryAndFilter(
query, and.getConstraint2(), selectorMap, searcher, reader);
if (filter == Predicate.TRUE) {
filter = other;
} else if (other != Predicate.TRUE) {
filter = Predicates.and(filter, other);
}