aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storageapi/message/queryresult.cpp
blob: 9580a948acbb2b0f737a86de455c8b46dcb63e13 (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
37
38
39
40
41
42
43
44
45
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "queryresult.h"
#include <ostream>

namespace storage {
namespace api {

IMPLEMENT_COMMAND(QueryResultCommand, QueryResultReply)
IMPLEMENT_REPLY(QueryResultReply)

QueryResultCommand::QueryResultCommand()
    : StorageCommand(MessageType::QUERYRESULT),
      _searchResult(),
      _summary()
{ }

void
QueryResultCommand::print(std::ostream& out, bool verbose,
                           const std::string& indent) const
{
    out << "QueryResultCommand(" << _searchResult.getHitCount() << " hits)";
    if (verbose) {
        out << " : ";
        StorageCommand::print(out, verbose, indent);
    }
}

QueryResultReply::QueryResultReply(const QueryResultCommand& cmd)
    : StorageReply(cmd)
{ }

void
QueryResultReply::print(std::ostream& out, bool verbose,
                         const std::string& indent) const
{
    out << "QueryResultReply()";
    if (verbose) {
        out << " : ";
        StorageReply::print(out, verbose, indent);
    }
}

} // api
} // storage