aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/query/tree/term.cpp
blob: 45ba259a7995c5d325263874d665d8a6ec34dcd8 (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
// 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)
{ }

void Term::setStateFrom(const Term& other) {
    setRanked(other.isRanked());
    setPositionData(other.usePositionData());
    // too late to copy this state:
    assert(_view == other.getView());
    assert(_id == other.getId());
    assert(_weight == other.getWeight());
}

}