use of com.yahoo.search.result.Hit in project vespa by vespa-engine.
the class FederationSearcherTest method require_that_hits_can_be_filled_for_multiple_chains_and_queries.
@Test
public void require_that_hits_can_be_filled_for_multiple_chains_and_queries() {
FederationTester tester = new FederationTester();
tester.addSearchChain("chain1", new AddHitSearcher());
tester.addSearchChain("chain2", new ModifyQueryAndAddHitSearcher("modified1"));
tester.addSearchChain("chain3", new ModifyQueryAndAddHitSearcher("modified2"));
Result result = tester.search();
tester.fill(result);
assertEquals(3, result.hits().getConcreteSize());
for (Iterator<Hit> i = result.hits().deepIterator(); i.hasNext(); ) assertFilled(i.next());
}
use of com.yahoo.search.result.Hit in project vespa by vespa-engine.
the class SetHitCountsSearcher method createLoggingHit.
private Hit createLoggingHit() {
Hit hit = new Hit("SetHitCountSearcher");
hit.setMeta(true);
hit.types().add("logging");
return hit;
}
use of com.yahoo.search.result.Hit in project vespa by vespa-engine.
the class GroupingRequestTestCase method requireThatResultIsFound.
@Test
public void requireThatResultIsFound() {
Query query = new Query();
GroupingRequest req = GroupingRequest.newInstance(query);
Result res = new Result(query);
res.hits().add(new Hit("foo"));
RootGroup bar = newRootGroup(0);
req.setResultGroup(bar);
res.hits().add(bar);
res.hits().add(new Hit("baz"));
Group grp = req.getResultGroup(res);
assertNotNull(grp);
assertSame(bar, grp);
}
use of com.yahoo.search.result.Hit in project vespa by vespa-engine.
the class GroupingRequestTestCase method requireThatNonGroupResultIsNull.
@Test
public void requireThatNonGroupResultIsNull() {
Query query = new Query();
GroupingRequest req = GroupingRequest.newInstance(query);
Result res = new Result(query);
RootGroup grp = newRootGroup(0);
req.setResultGroup(grp);
res.hits().add(new Hit(grp.getId().toString()));
assertNull(req.getResultGroup(res));
}
use of com.yahoo.search.result.Hit in project vespa by vespa-engine.
the class GroupTestCase method requireThatListsAreAccessibleByLabel.
@Test
public void requireThatListsAreAccessibleByLabel() {
Group grp = new Group(new LongId(69L), new Relevance(1));
grp.add(new Hit("hit"));
grp.add(new HitList("hitList"));
grp.add(new GroupList("groupList"));
assertNotNull(grp.getGroupList("groupList"));
assertNull(grp.getGroupList("unknownGroupList"));
assertNull(grp.getGroupList("hitList"));
assertNotNull(grp.getHitList("hitList"));
assertNull(grp.getHitList("unknownHitList"));
assertNull(grp.getHitList("groupList"));
}
Aggregations