use of com.yahoo.search.grouping.result.HitList in project vespa by vespa-engine.
the class GroupingExecutorTestCase method requireThatDefaultSummaryNameFillsHitsWithNull.
@Test
public void requireThatDefaultSummaryNameFillsHitsWithNull() {
Query query = newQuery();
GroupingRequest req = GroupingRequest.newInstance(query);
req.setRootOperation(GroupingOperation.fromString("all(group(foo) each(each(output(summary()))) as(foo))"));
Grouping pass0 = new Grouping(0);
pass0.setRoot(new com.yahoo.searchlib.aggregation.Group().addChild(new com.yahoo.searchlib.aggregation.Group().setId(new StringResultNode("foo")).addAggregationResult(new HitsAggregationResult(1, ExpressionConverter.DEFAULT_SUMMARY_NAME))));
Grouping pass1 = new Grouping(0);
pass1.setRoot(new com.yahoo.searchlib.aggregation.Group().addChild(new com.yahoo.searchlib.aggregation.Group().setId(new StringResultNode("foo")).addAggregationResult(new HitsAggregationResult(1, ExpressionConverter.DEFAULT_SUMMARY_NAME).addHit(new com.yahoo.searchlib.aggregation.FS4Hit()))));
Execution exec = newExecution(new GroupingExecutor(), new ResultProvider(Arrays.asList(new GroupingListHit(Arrays.asList(pass0), null), new GroupingListHit(Arrays.asList(pass1), null))));
Result res = exec.search(query);
exec.fill(res);
Hit hit = ((HitList) ((Group) ((GroupList) req.getResultGroup(res).get(0)).get(0)).get(0)).get(0);
assertTrue(hit instanceof FastHit);
assertTrue(hit.isFilled(null));
}
use of com.yahoo.search.grouping.result.HitList in project vespa by vespa-engine.
the class UniqueGroupingSearcherTestCase method makeHitGroup.
private static Group makeHitGroup(String name) {
Group ein = new Group(new StringId(name), new Relevance(0));
HitList hits = new HitList(UniqueGroupingSearcher.LABEL_HITS);
hits.add(new Hit(name));
ein.add(hits);
return ein;
}
use of com.yahoo.search.grouping.result.HitList in project vespa by vespa-engine.
the class UniqueGroupingSearcherTestCase method makeSortingHitGroup.
private static Group makeSortingHitGroup(String name) {
Hit hit = new Hit(name);
HitList hits = new HitList(UniqueGroupingSearcher.LABEL_HITS);
hits.add(hit);
Group dedupGroup = new Group(new StringId(name), new Relevance(0));
dedupGroup.add(hits);
GroupList dedupedHits = new GroupList(UniqueGroupingSearcher.LABEL_GROUPS);
dedupedHits.add(dedupGroup);
Group ein = new Group(new StringId(name), new Relevance(0));
ein.add(dedupedHits);
return ein;
}
Aggregations