aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/features/max_reduce_prod_join_replacer.h
blob: f546eeaf6ae8b431b185a3c7b76a14d4e6b47aaa (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "internal_max_reduce_prod_join_feature.h"
#include <vespa/searchlib/features/rankingexpression/expression_replacer.h>

namespace search::features {

/**
 * ExpressionReplacer that will replacing expressions on the form:
 *
 *      reduce(
 *          join(
 *              tensorFromLabels(attribute(A), dim),
 *              tensorFromWeightedset(query(Q), dim),
 *              f(x,y)(x*y)
 *          ),
 *          max
 *      )
 *
 * With a parameterized (A, Q) adaption of the given blueprint
 * (default: InternalMaxReduceProdJoinBlueprint).
 **/
struct MaxReduceProdJoinReplacer {
    using ExpressionReplacer = rankingexpression::ExpressionReplacer;
    static ExpressionReplacer::UP create(fef::Blueprint::UP proto);
    static ExpressionReplacer::UP create() {
        return create(std::make_unique<InternalMaxReduceProdJoinBlueprint>());
    }
};

} // namespace search::features