@Test
    void testTermAnnotations() {
        assertEquals("merkelapp",
                getRootWord("select foo from bar where baz contains " +
                        "({label: \"merkelapp\"}\"colors\")").getLabel());
        assertEquals("another",
                getRootWord("select foo from bar where baz contains " +
                        "({annotations: {cox: \"another\"}}\"colors\")").getAnnotation("cox"));
        assertEquals(23.0, getRootWord("select foo from bar where baz contains " +
                "({significance: 23.0}\"colors\")").getSignificance(), 1E-6);
        assertEquals(Optional.of(new DocumentFrequency(13, 101)),
                getRootWord("select foo from bar where baz contains " +
                "({documentFrequency: {frequency: 13, count: 101L}}\"colors\")").getDocumentFrequency());
        assertEquals(23, getRootWord("select foo from bar where baz contains " +
                "({id: 23}\"colors\")").getUniqueID());
        assertEquals(150, getRootWord("select foo from bar where baz contains " +
                "({weight: 150}\"colors\")").getWeight());
        assertFalse(getRootWord("select foo from bar where baz contains " +
                "({usePositionData: false}\"colors\")").usePositionData());
        assertTrue(getRootWord("select foo from bar where baz contains " +
                "({filter: true}\"colors\")").isFilter());
        assertFalse(getRootWord("select foo from bar where baz contains " +
                "({ranked: false}\"colors\")").isRanked());

        Substring origin = getRootWord("select foo from bar where baz contains " +
                "({origin: {original: \"abc\", offset: 1, length: 2}}" +
                "\"colors\")").getOrigin();
        assertEquals("abc", origin.string);
        assertEquals(1, origin.start);
        assertEquals(3, origin.end);
    }
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