summaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/aggregation/fs4hit.h
blob: 7cb078fe7e8a68b33cba52e6b241d5dee8fd29d1 (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
35
36
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "hit.h"
#include "aggregationresult.h"
#include <vespa/document/base/globalid.h>
#include <vespa/searchlib/common/docstamp.h>

namespace search::aggregation {

class FS4Hit : public Hit
{
private:
    uint32_t _path;
    uint32_t _docId;
    document::GlobalId _globalId;
    uint32_t _distributionKey;

public:
    DECLARE_IDENTIFIABLE_NS2(search, aggregation, FS4Hit);
    DECLARE_NBO_SERIALIZE;
    FS4Hit() noexcept : Hit(), _path(0), _docId(0), _globalId(), _distributionKey(-1) {}
    FS4Hit(DocId docId, HitRank rank)
        : Hit(rank), _path(0), _docId(docId), _globalId(), _distributionKey(-1) {}
    FS4Hit *clone() const override { return new FS4Hit(*this); }
    void visitMembers(vespalib::ObjectVisitor &visitor) const override;
    uint32_t getPath() const { return _path; }
    FS4Hit &setPath(uint32_t val) { _path = val; return *this; }
    uint32_t getDocId() const { return _docId; }
    const document::GlobalId & getGlobalId() const { return _globalId; }
    FS4Hit &setGlobalId(const document::GlobalId & globalId) { _globalId = globalId; return *this; }
    FS4Hit &setDistributionKey(uint32_t val) { _distributionKey = val; return *this; }
    bool operator < (const FS4Hit &b) const { return cmp(b) < 0; }
};

}