blob: 5e7964ea260b5780909995f8a446e21373a352a3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// Copyright Vespa.ai. 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;
}
}
|