blob: d78f463f91d74630d78666f6f39239cada0d206d (
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 "getdocsumargs.h"
#include <vespa/vespalib/stllike/hash_set_insert.hpp>
namespace search::docsummary {
GetDocsumArgs::GetDocsumArgs()
: _resultClassName(),
_dumpFeatures(false),
_locations_possible(true),
_stackDump(),
_location(),
_timeout(30s),
_highlightTerms(),
_fields()
{ }
GetDocsumArgs::~GetDocsumArgs() = default;
void
GetDocsumArgs::initFromDocsumRequest(const engine::DocsumRequest &req)
{
_dumpFeatures = req.dumpFeatures;
_resultClassName = req.resultClassName;
_stackDump = req.stackDump;
_location = req.location;
_locations_possible = true;
_timeout = req.getTimeLeft();
_highlightTerms = req.propertiesMap.highlightTerms();
_fields = FieldSet(req.getFields().begin(), req.getFields().end());
}
void
GetDocsumArgs::setStackDump(uint32_t stackDumpLen, const char *stackDump)
{
_stackDump.assign(stackDump, stackDump + stackDumpLen);
}
bool
GetDocsumArgs::need_field(vespalib::stringref field) const {
return _fields.empty() || _fields.contains(field);
}
}
|