@Test
    public void testMatch() {
        // Ordered by decreasing match score per query
        assertMetrics("match:1",     "a","a");
        assertMetrics("match:0.9339","a","a x");
        assertMetrics("match:0",     "a","x");
        assertMetrics("match:0.9243","a","x a");
        assertMetrics("match:0.9025","a","x a x");

        assertMetrics("match:1",     "a b","a b");
        assertMetrics("match:0.9558","a b","a b x");
        assertMetrics("match:0.9463","a b","x a b");
        assertMetrics("match:0.1296","a b","a x x x x x x x x x x x x x x x x x x x x x x b");
        assertMetrics("match:0.1288","a b","a x x x x x x x x x x x x x x x x x x x x x x x x x x x b");

        assertMetrics("match:0.8647","a b c","x x a x b x x x x x x x x a b c x x x x x x x x c x x");
        assertMetrics("match:0.861", "a b c","x x a x b x x x x x x x x x x a b c x x x x x x c x x");
        assertMetrics("match:0.4869","a b c","a b x x x x x x x x x x x x x x x x x x x x x x c x x");
        assertMetrics("match:0.4853","a b c","x x a x b x x x x x x x x x x b a c x x x x x x c x x");
        assertMetrics("match:0.3621","a b c","a x b x x x x x x x x x x x x x x x x x x x x x c x x");
        assertMetrics("match:0.3619","a b c","x x a x b x x x x x x x x x x x x x x x x x x x c x x");
        assertMetrics("match:0.3584","a b c","x x a x b x x x x x x x x x x x x x x x x x x x x x c");
        assertMetrics("match:0.3474","a b c","x x a x b x x x x x x x x x x x x x x b x x x b x b x");
        assertMetrics("match:0.3421","a b c","x x a x b x x x x x x x x x x x x x x x x x x x x x x");
        assertMetrics("match:0.305" ,"a b c","x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x");
        assertMetrics("match:0.2927","a b!200 c","x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x");
    }
Test cases where we choose between multiple different segmentations
searchlib/src/test/java/com/yahoo/searchlib/ranking/features/fieldmatch/test/FieldMatchMetricsTestCase.java