Search in sources :

Example 1 with Presentation

use of com.yahoo.search.query.Presentation in project vespa by vespa-engine.

the class PresentationTestCase method testClone.

public void testClone() {
    Query q = new Query("");
    Presentation p = new Presentation(q);
    p.setBolding(true);
    Highlight h = new Highlight();
    h.addHighlightTerm("date", "today");
    p.setHighlight(h);
    Presentation pc = (Presentation) p.clone();
    h.addHighlightTerm("title", "Hello");
    assertTrue(pc.getBolding());
    pc.getHighlight().getHighlightItems();
    assertTrue(pc.getHighlight().getHighlightItems().containsKey("date"));
    assertFalse(pc.getHighlight().getHighlightItems().containsKey("title"));
    assertEquals(p, pc);
}
Also used : Highlight(com.yahoo.prelude.query.Highlight) Query(com.yahoo.search.Query) Presentation(com.yahoo.search.query.Presentation)

Aggregations

Highlight (com.yahoo.prelude.query.Highlight)1 Query (com.yahoo.search.Query)1 Presentation (com.yahoo.search.query.Presentation)1