void onComplete() {
        // segment distance - calculated from sorted segment starts
        if (segmentStarts.size() <= 1) {
            segmentDistance = 0;
        }
        else {
            Collections.sort(segmentStarts);
            for (int i = 1; i < segmentStarts.size(); i++) {
                segmentDistance += segmentStarts.get(i) - segmentStarts.get(i - 1) + 1;
            }
        }

        if (head == -1) head = 0;
        if (tail == -1) tail = 0;
    }
Called once when matching is complete
searchlib/src/main/java/com/yahoo/searchlib/ranking/features/fieldmatch/FieldMatchMetrics.java