@Test
    public void testProximity() {
        assertMetrics("absoluteProximity:0.1    proximity:1",     "a b","a b");
        assertMetrics("absoluteProximity:0.3    proximity:1",     "a 0.3:b","a b");
        assertMetrics("absoluteProximity:0.1    proximity:1",     "a 0.0:b","a b");
        assertMetrics("absoluteProximity:1      proximity:1",     "a 1.0:b","a b");
        assertMetrics("absoluteProximity:0.033  proximity:0.33",  "a b","b a");
        assertMetrics("absoluteProximity:0.0108 proximity:0.0359","a 0.3:b","b a"); // Should be worse than the previous one
        assertMetrics("absoluteProximity:0.1    proximity:1",     "a 0.0:b","b a");
        assertMetrics("absoluteProximity:0      proximity:0",     "a 1.0:b","b a");

        // proximity with connextedness
        assertMetrics("absoluteProximity:0.0605 proximity:0.605", "a b c","a x b x x c");
        assertMetrics("absoluteProximity:0.0701 proximity:0.2003","a 0.5:b 0.2:c","a x b x x c"); // Most important is close, less important is far: Better
        assertMetrics("absoluteProximity:0.0605 proximity:0.605", "a b c","a x x b x c");
        assertMetrics("absoluteProximity:0.0582 proximity:0.1663","a 0.5:b 0.2:c","a x x b x c"); // Most important is far, less important is close: Worse

        assertMetrics("absoluteProximity:0.0727 proximity:0.7267","a b c d","a b x x x x x c d");
        assertMetrics("absoluteProximity:0.1    proximity:1",     "a b 0:c d","a b x x x x x c d"); // Should be better because the gap is unimportant
    }
Calculated the same way as weight
searchlib/src/test/java/com/yahoo/searchlib/ranking/features/fieldmatch/test/FieldMatchMetricsTestCase.java