aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/attribute/numeric_matcher.hpp
blob: 8dc8ec47c5aabf3db40c03adfd6ddf163e506b9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "numeric_matcher.h"
#include <vespa/searchlib/query/query_term_simple.h>

namespace search::attribute {

template<typename T>
NumericMatcher<T>::NumericMatcher(const QueryTermSimple& queryTerm, bool avoidUndefinedInRange)
    : _value(0),
      _valid(false)
{
    (void) avoidUndefinedInRange;
    QueryTermSimple::RangeResult<T> res = queryTerm.getRange<T>();
    _valid = res.valid && res.isEqual() && !res.adjusted;
    _value = res.high;
}

}