blob: 3c0f60b5b3fba0cd7a41f1937635d3db15e6f076 (
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 Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/searchlib/common/featureset.h>
#include <vector>
namespace vespalib { struct ThreadBundle; };
namespace search::queryeval { class SearchIterator; }
namespace search::fef { class RankProgram; }
namespace proton::matching {
class MatchToolsFactory;
struct ExtractFeatures {
using FeatureSet = search::FeatureSet;
using FeatureValues = search::FeatureValues;
using ThreadBundle = vespalib::ThreadBundle;
using SearchIterator = search::queryeval::SearchIterator;
using RankProgram = search::fef::RankProgram;
/**
* Extract all seed features from a rank program for a list of
* documents (must be in ascending order) using unpack information
* from a search.
**/
static FeatureSet::UP get_feature_set(SearchIterator &search, RankProgram &rank_program, const std::vector<uint32_t> &docs);
// first: docid, second: result index (must be sorted on docid)
using OrderedDocs = std::vector<std::pair<uint32_t,uint32_t>>;
/**
* Extract match features using multiple threads.
**/
static FeatureValues get_match_features(const MatchToolsFactory &mtf, const OrderedDocs &docs, ThreadBundle &thread_bundle);
};
}
|