blob: 6f795c313564dfcb6448be05d36c1e71edfbb91f (
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
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "queryterm.h"
namespace search::fef {
class ITermData;
class MatchData;
}
namespace search::query { class TermVector; }
namespace search::streaming {
/*
* Base class for query term nodes that are considered leaf nodes by
* the ranking framework but still have multiple terms used for
* search.
*/
class MultiTerm : public QueryTerm {
protected:
std::vector<std::unique_ptr<QueryTerm>> _terms;
public:
MultiTerm(std::unique_ptr<QueryNodeResultBase> result_base, const string & index, uint32_t num_terms);
MultiTerm(std::unique_ptr<QueryNodeResultBase> result_base, const string & index,
std::unique_ptr<query::TermVector> terms, Normalizing normalizing);
~MultiTerm() override;
void add_term(std::unique_ptr<QueryTerm> term);
MultiTerm* as_multi_term() noexcept override { return this; }
void reset() override;
bool evaluate() const override;
virtual void unpack_match_data(uint32_t docid, const fef::ITermData& td, fef::MatchData& match_data) = 0;
const std::vector<std::unique_ptr<QueryTerm>>& get_terms() const noexcept { return _terms; }
};
}
|