@Test
    void testConnectivity() {
        QueryTree parsed = parse("select foo from bar where " +
                "title contains ({id: 1, connectivity: {\"id\": 3, weight: 7.0}}\"madonna\") " +
                "and title contains ({id: 2}\"saint\") " +
                "and title contains ({id: 3}\"angel\")");
        assertEquals("AND title:madonna title:saint title:angel", parsed.toString());
        AndItem root = (AndItem) parsed.getRoot();
        WordItem first = (WordItem) root.getItem(0);
        WordItem second = (WordItem) root.getItem(1);
        WordItem third = (WordItem) root.getItem(2);
        assertEquals(first.getConnectedItem(), third);
        assertEquals(first.getConnectivity(), 7.0d, 1E-6);
        assertNull(second.getConnectedItem());

        assertParseFail("select foo from bar where " +
                "title contains ({id: 1, connectivity: {id: 4, weight: 7.0}}\"madonna\") " +
                "and title contains ({id: 2}\"saint\") " +
                "and title contains ({id: 3}\"angel\")",
                new IllegalArgumentException("Item 'title:madonna' was specified to connect to item with ID 4, " +
                        "which does not exist in the query."));
    }
Specification for the conversion of YQL+ expressions to Vespa search queries.

@author Steinar Knutsen
@author Stian Kristoffersen
container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java