use of com.yahoo.search.result.Relevance in project vespa by vespa-engine.
the class QuotingSearcherTestCase method testBasicQuoting.
public void testBasicQuoting() {
Map<Searcher, Searcher> chained = new HashMap<>();
Searcher s = createQuotingSearcher("file:src/test/java/com/yahoo/prelude/" + "searcher/test/testquoting.cfg");
DocumentSourceSearcher docsource = new DocumentSourceSearcher();
chained.put(s, docsource);
Query q = new Query("?query=a");
Result r = new Result(q);
Hit hit = new FastHit();
hit.setId("http://abc.html");
hit.setRelevance(new Relevance(1));
hit.setField("title", "smith & jones");
r.hits().add(hit);
docsource.addResultSet(q, r);
Result check = doSearch(s, q, 0, 10, chained);
assertEquals("smith & jones", check.hits().get(0).getField("title").toString());
assertTrue(check.hits().get(0).fields().containsKey("title"));
}
Aggregations