private DocumentCollection intersectDistTerms(Term left, Term right, CoordinateOpImpl operator) {
        DocumentCollection lDocs = index.findDocuments(left);
        DocumentCollection rDocs = index.findDocuments(right);
        DocumentSet res = new DocumentSet();
        for (Document lDoc : lDocs) {
            for (Document rDoc : rDocs) {
                if (lDoc.getPath().equals(rDoc.getPath())) {
                    int lPos = ((CoordinateDocument) lDoc).getPosition();
                    int rPos = ((CoordinateDocument) rDoc).getPosition();
                    int dist = rPos - lPos;

                    boolean applicable = false;
                    switch (operator.getDirection()) {
                        case LEFT: case RIGHT:
                            applicable = dist == operator.getDistance();
                            break;
                        case ANY:
                            applicable = Math.abs(dist) == operator.getDistance();
                            break;
                    }

                    if (applicable) {
                        res.add(lDoc);
                    }
                }
            }
        }
        return res;
    }