@Test
    void testComplexExactMatching() {
        SearchDefinition sd = new SearchDefinition("foobar");
        String u_name = "foo_bar";
        Index u_index = new Index(u_name);
        u_index.setExact(true, "^^^");
        Index b_index = new Index("bar");
        sd.addIndex(u_index);
        sd.addIndex(b_index);

        IndexFacts indexFacts = new IndexFacts(new IndexModel(sd));
        Query query = new Query();
        query.getModel().getSources().add("foobar");
        IndexFacts.Session session = indexFacts.newSession(query);
        assertFalse(session.getIndex("bar").isExact());
        assertTrue(session.getIndex(u_name).isExact());
        Query q = newQuery("?query=" + u_name + ":foo...&search=foobar&type=all", indexFacts);
        assertEquals(u_name + ":foo...", q.getModel().getQueryTree().getRoot().toString());
    }
Tests using synthetic index names for IndexFacts class.

@author Steinar Knutsen
container-search/src/test/java/com/yahoo/prelude/test/IndexFactsTestCase.java