aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/attribute/numeric_search_context.hpp
blob: 56e6b3321d457ddb1a68db9bf5376888d9e7f002 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "numeric_search_context.h"

namespace search::attribute {

template <typename Matcher>
NumericSearchContext<Matcher>::NumericSearchContext(const AttributeVector& to_be_searched, const QueryTermSimple& query_term, bool avoid_undefined_range)
    : SearchContext(to_be_searched),
      Matcher(query_term, avoid_undefined_range)
{
}

template <typename Matcher>
NumericSearchContext<Matcher>::NumericSearchContext(const AttributeVector& to_be_searched, Matcher &&matcher)
    : SearchContext(to_be_searched),
      Matcher(std::move(matcher))
{
}

template <typename Matcher>
Int64Range
NumericSearchContext<Matcher>::getAsIntegerTerm() const
{
    return Matcher::getRange();
}

template <typename Matcher>
DoubleRange
NumericSearchContext<Matcher>::getAsDoubleTerm() const
{
    return Matcher::getDoubleRange();
}

template <typename Matcher>
bool
NumericSearchContext<Matcher>::valid() const
{
    return Matcher::isValid();
}

}