Search in sources :

Example 6 with HitsAggregationResult

use of com.yahoo.searchlib.aggregation.HitsAggregationResult in project vespa by vespa-engine.

the class GroupingExecutorTestCase method requireThatUnfilledHitsRenderError.

@Test
public void requireThatUnfilledHitsRenderError() throws IOException {
    Query query = newQuery();
    GroupingRequest req = GroupingRequest.newInstance(query);
    req.setRootOperation(GroupingOperation.fromString("all(group(foo) each(each(output(summary(bar)))))"));
    Grouping grp0 = new Grouping(0);
    grp0.setRoot(new com.yahoo.searchlib.aggregation.Group().addChild(new com.yahoo.searchlib.aggregation.Group().setId(new StringResultNode("foo")).addAggregationResult(new HitsAggregationResult(1, "bar"))));
    Grouping grp1 = new Grouping(0);
    grp1.setRoot(new com.yahoo.searchlib.aggregation.Group().addChild(new com.yahoo.searchlib.aggregation.Group().setId(new StringResultNode("foo")).addAggregationResult(new HitsAggregationResult(1, "bar").addHit(new com.yahoo.searchlib.aggregation.FS4Hit()))));
    Execution exec = newExecution(new GroupingExecutor(), new ResultProvider(Arrays.asList(new GroupingListHit(Arrays.asList(grp0), null), new GroupingListHit(Arrays.asList(grp1), null))), new FillErrorProvider());
    Result res = exec.search(query);
    exec.fill(res);
    assertNotNull(res.hits().getError());
}
Also used : Group(com.yahoo.search.grouping.result.Group) Query(com.yahoo.search.Query) Grouping(com.yahoo.searchlib.aggregation.Grouping) GroupingListHit(com.yahoo.prelude.fastsearch.GroupingListHit) Result(com.yahoo.search.Result) HitsAggregationResult(com.yahoo.searchlib.aggregation.HitsAggregationResult) CountAggregationResult(com.yahoo.searchlib.aggregation.CountAggregationResult) MinAggregationResult(com.yahoo.searchlib.aggregation.MinAggregationResult) MaxAggregationResult(com.yahoo.searchlib.aggregation.MaxAggregationResult) HitsAggregationResult(com.yahoo.searchlib.aggregation.HitsAggregationResult) Execution(com.yahoo.search.searchchain.Execution) GroupingRequest(com.yahoo.search.grouping.GroupingRequest) StringResultNode(com.yahoo.searchlib.expression.StringResultNode) Test(org.junit.Test)

Aggregations

GroupingListHit (com.yahoo.prelude.fastsearch.GroupingListHit)6 Query (com.yahoo.search.Query)6 GroupingRequest (com.yahoo.search.grouping.GroupingRequest)6 Group (com.yahoo.search.grouping.result.Group)6 Execution (com.yahoo.search.searchchain.Execution)6 Grouping (com.yahoo.searchlib.aggregation.Grouping)6 HitsAggregationResult (com.yahoo.searchlib.aggregation.HitsAggregationResult)6 StringResultNode (com.yahoo.searchlib.expression.StringResultNode)6 Test (org.junit.Test)6 Result (com.yahoo.search.Result)4 CountAggregationResult (com.yahoo.searchlib.aggregation.CountAggregationResult)4 MaxAggregationResult (com.yahoo.searchlib.aggregation.MaxAggregationResult)4 MinAggregationResult (com.yahoo.searchlib.aggregation.MinAggregationResult)4 DocumentId (com.yahoo.document.DocumentId)2 GlobalId (com.yahoo.document.GlobalId)2 FastHit (com.yahoo.prelude.fastsearch.FastHit)2 Hit (com.yahoo.search.result.Hit)2 GroupList (com.yahoo.search.grouping.result.GroupList)1 HitList (com.yahoo.search.grouping.result.HitList)1