public float getRelatedness() {
        if (matches == 0) return 0;
        if (matches == 1) return 1;
        return 1 - (float)(segments - 1) / (matches - 1);
    }
Returns the degree to which different terms are related (occurring in the same segment): <code>1-segments/(matches-1)</code>
searchlib/src/main/java/com/yahoo/searchlib/ranking/features/fieldmatch/FieldMatchMetrics.java