summaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/fef/test/plugin/staticrank.h
blob: 38f931caa6ba66858ee20feeb692db1f25ca058a (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
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <string>
#include <vector>
#include <vespa/searchlib/fef/blueprint.h>
#include <vespa/searchlib/fef/featureexecutor.h>

namespace search {
namespace fef {
namespace test {

class StaticRankExecutor : public FeatureExecutor
{
private:
    const search::attribute::IAttributeVector * _attribute;

public:
    StaticRankExecutor(const search::attribute::IAttributeVector * attribute);
    virtual void execute(uint32_t docId);
};


class StaticRankBlueprint : public Blueprint
{
private:
    std::string _attributeName;

public:
    StaticRankBlueprint();
    virtual void visitDumpFeatures(const IIndexEnvironment &, IDumpFeatureVisitor &) const {}
    virtual Blueprint::UP createInstance() const { return Blueprint::UP(new StaticRankBlueprint()); }
    virtual bool setup(const IIndexEnvironment & indexEnv, const StringVector & params);
    virtual FeatureExecutor &createExecutor(const IQueryEnvironment &queryEnv, vespalib::Stash &stash) const override;
};

} // namespace test
} // namespace fef
} // namespace search