void onPair(int i, int j, int previousJ) {
        int distance = j - previousJ - 1;
        if (distance < 0) distance++; // Discontinuity where the two terms are in the same position
        if (abs(distance) > source.getParameters().getProximityLimit()) return; // Contribution=0

        // We have an in-segment pair
        float pairProximity = source.getParameters().getProximity(distance + source.getParameters().getProximityLimit());

        unweightedProximity += pairProximity;

        float connectedness = source.getQuery().getTerms()[i].getConnectedness();
        proximity += (float)pow(pairProximity, connectedness / 0.1) * (float)max(0.1, connectedness);

        pairs++;
    }
Called when <i>any</i> pair is encountered
searchlib/src/main/java/com/yahoo/searchlib/ranking/features/fieldmatch/FieldMatchMetrics.java