blob: 64489f68d4b52f06f8a9a97ecfbe22b72ee25edf (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/searchlib/features/fieldmatch/computer.h>
#include <vespa/searchlib/features/fieldmatch/params.h>
#include <vespa/searchlib/fef/blueprint.h>
namespace search {
namespace features {
/**
* Implements the executor for THE field match feature.
*/
class FieldMatchExecutor : public fef::FeatureExecutor {
private:
fef::PhraseSplitter _splitter;
const fef::FieldInfo & _field;
const fieldmatch::Params & _params;
fieldmatch::Computer _cmp;
void handle_bind_match_data(fef::MatchData &md) override;
public:
/**
* Constructs an executor.
*/
FieldMatchExecutor(const fef::IQueryEnvironment & queryEnv,
const fef::FieldInfo & field,
const fieldmatch::Params & params);
void execute(uint32_t docId) override;
};
/**
* Implements the blueprint for THE field match feature.
*/
class FieldMatchBlueprint : public fef::Blueprint {
private:
const fef::FieldInfo * _field;
fieldmatch::Params _params;
public:
FieldMatchBlueprint();
~FieldMatchBlueprint();
void visitDumpFeatures(const fef::IIndexEnvironment & env, fef::IDumpFeatureVisitor & visitor) const override;
fef::Blueprint::UP createInstance() const override;
fef::ParameterDescriptions getDescriptions() const override {
return fef::ParameterDescriptions().desc().indexField(fef::ParameterCollection::SINGLE);
}
bool setup(const fef::IIndexEnvironment & env, const fef::ParameterList & params) override;
fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override;
};
} // namespace features
} // namespace search
|