summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/prelude/fastsearch/GroupingListHit.java
blob: 7e60f8a41b6e16f38af131005dfaab89ce413925 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.fastsearch;

import java.util.List;

import com.yahoo.search.Query;
import com.yahoo.search.result.Hit;
import com.yahoo.search.schema.Schema;
import com.yahoo.searchlib.aggregation.Grouping;

public class GroupingListHit extends Hit {

    /** for unit tests only, may give problems if grouping contains docsums */
    public GroupingListHit(List<Grouping> groupingList) {
        this(groupingList, null, null);
    }

    public GroupingListHit(List<Grouping> groupingList, DocumentDatabase documentDatabase, Query query) {
        super("meta:grouping", 0, query);
        this.groupingList = groupingList;
        this.documentDatabase = documentDatabase;
    }

    public boolean isMeta() { return true; }

    public List<Grouping> getGroupingList() { return groupingList; }
    public DocsumDefinitionSet getDocsumDefinitionSet() { return documentDatabase.getDocsumDefinitionSet(); }
    public Schema getSchema() { return documentDatabase.schema(); }
    public DocumentDatabase getDocumentDatBase() { return documentDatabase; }

    private final List<Grouping> groupingList;
    private final DocumentDatabase documentDatabase;

}