@Test
    public void testQueryRepeats() {
        // Not really handled perfectly, but good enough
        assertMetrics("absoluteProximity:0.1    proximity:1      head:0 tail:0",            "a a a","a");
        assertMetrics("absoluteProximity:0.1    proximity:1      head:0 tail:0 gapLength:0","a a b c c","a a b c c");
        assertMetrics("absoluteProximity:0.1    proximity:1      head:0 tail:0 gapLength:0","a a b c c","a b c");
        assertMetrics("absoluteProximity:0.1    proximity:1      head:0 tail:0 gapLength:0","a b a b","a b a b");
        assertMetrics("absoluteProximity:0.0903 proximity:0.9033 head:0 tail:0 gapLength:1","a b a b","a b x a b");
        // Both terms take the same segment:
        assertMetrics("absoluteProximity:0.1 proximity:1 segments:2 gapLength:0 head:3 tail:18","a a","x x x a x x x x x x x x x x x x x x a x x x");
        // But not when the second is preferable
        assertMetrics("absoluteProximity:0.1 proximity:1 segments:2 gapLength:0 head:3 tail:3","a b b a","x x x a b x x x x x x x x x x x x x x b a x x x");

        assertMetrics("matches:2 fieldCompleteness:1","a b b b","a b");
    }
Test cases where we choose between multiple different segmentations
searchlib/src/test/java/com/yahoo/searchlib/ranking/features/fieldmatch/test/FieldMatchMetricsTestCase.java