@Test
    void testImplicitAnd() {
        Query query = new Query(httpEncode("?query=myfield:it's myfield:a.b myfield:c"));

        SearchDefinition test = new SearchDefinition("test");
        Index myField = new Index("myfield");
        myField.addCommand("phrase-segmenting false");
        assertFalse(myField.getPhraseSegmenting());
        test.addIndex(myField);
        IndexModel indexModel = new IndexModel(test);
        query.getModel().setExecution(new Execution(Execution.Context.createContextStub(new IndexFacts(indexModel))));
        useParserSettings(query);
        assertEquals("WEAKAND(100) (SAND myfield:it myfield:s) (AND myfield:a myfield:b) myfield:c", query.getModel().getQueryTree().toString());
        // 'it' and 's' should have connectivity 1
        WeakAndItem root = (WeakAndItem) query.getModel().getQueryTree().getRoot();
        AndSegmentItem sand = (AndSegmentItem) root.getItem(0);
        WordItem it = (WordItem) sand.getItem(0);
        assertEquals("it", it.getWord());
        WordItem s = (WordItem) sand.getItem(1);
        assertEquals("s", s.getWord());
        assertEquals(s, it.getConnectedItem());
        assertEquals(1.0, it.getConnectivity(), 0.00000001);
        query = new Query(httpEncode("?query=myfield:it's myfield:a.b myfield:c"));
        query.getModel().setExecution(new Execution(Execution.Context.createContextStub(new IndexFacts(indexModel))));
        assertEquals("WEAKAND(100) myfield:it myfield:s (AND myfield:a myfield:b) myfield:c", query.getModel().getQueryTree().toString());
        query = new Query(httpEncode("?query=myfield:it's myfield:a.b myfield:c"));
        query.getModel().setExecution(new Execution(Execution.Context.createContextStub(new IndexFacts(indexModel))));
        disableParserSettings(query);
        assertEquals("WEAKAND(100) myfield:it myfield:s myfield:a myfield:b myfield:c", query.getModel().getQueryTree().toString());
    }
Test that we get the last value if a parameter is assigned multiple times
container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java