aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/attribute/numeric_search_context.h
blob: 0b6db3c8b18763fc1c7c5f7c3a7eaaaa3994f7ae (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "search_context.h"

namespace search::attribute {

/*
 * NumericSearchContext is an abstract base class for search contexts
 * handling a query term on a numeric attribute vector.
 */
template <typename Matcher>
class NumericSearchContext : public SearchContext, public Matcher
{
protected:
    using MatcherType = Matcher;
public:
    NumericSearchContext(const AttributeVector& to_be_searched, const QueryTermSimple& query_term, bool avoid_undefined_range);
    NumericSearchContext(const AttributeVector& to_be_searched, Matcher&& matcher);
    Int64Range getAsIntegerTerm() const override;
    DoubleRange getAsDoubleTerm() const override;
    bool valid() const override;
};

}