blob: 35f6ea5c8f5d62a2577915527a93e1172fff004b (
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
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "term.h"
#include <cassert>
namespace search::query {
Term::~Term() = default;
Term::Term(vespalib::stringref view, int32_t id, Weight weight) :
_view(view),
_id(id),
_weight(weight),
_ranked(true),
_position_data(true),
_prefix_match(false)
{ }
void Term::setStateFrom(const Term& other) {
setRanked(other.isRanked());
setPositionData(other.usePositionData());
set_prefix_match(other.prefix_match());
// too late to copy this state:
assert(_view == other.getView());
assert(_id == other.getId());
assert(_weight == other.getWeight());
}
}
|