summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
diff options
context:
space:
mode:
authorHÃ¥vard Pettersen <3535158+havardpe@users.noreply.github.com>2021-05-20 10:14:00 +0200
committerGitHub <noreply@github.com>2021-05-20 10:14:00 +0200
commitc8746c75e6ad4dad17ecd3daf2916fe45fd594f9 (patch)
tree394c82dd3da28d65e1d567d65ce80f1399c9f006 /searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
parentfc0711f7870b55ea77d18d87ec3e70b75e0de2e0 (diff)
parent58c6c0405e588908df90801e69ed7931ddc577e9 (diff)
Merge pull request #17885 from vespa-engine/havardpe/external-ranking-expressions
external ranking expressions
Diffstat (limited to 'searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp')
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
index aed01ca0192..544ff853384 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
@@ -17,6 +17,7 @@ using namespace search::index;
using namespace search;
using namespace vespa::config::search;
using proton::matching::RankingConstants;
+using proton::matching::RankingExpressions;
using proton::matching::OnnxModels;
using std::make_shared;
using std::shared_ptr;
@@ -69,6 +70,11 @@ public:
_builder.rankingConstants(make_shared<RankingConstants>(constants));
return *this;
}
+ MyConfigBuilder &addRankingExpression() {
+ auto expr_list = RankingExpressions().add("my_expr", "my_file");
+ _builder.rankingExpressions(make_shared<RankingExpressions>(expr_list));
+ return *this;
+ }
MyConfigBuilder &addOnnxModel() {
OnnxModels::Vector models = {{"my_model_name", "my_model_file"}};
_builder.onnxModels(make_shared<OnnxModels>(models));
@@ -138,6 +144,7 @@ struct Fixture {
fullCfg = MyConfigBuilder(4, schema, repo).addAttribute().
addRankProfile().
addRankingConstant().
+ addRankingExpression().
addOnnxModel().
addImportedField().
addSummary(true).
@@ -173,6 +180,7 @@ struct DelayAttributeAspectFixture {
attrCfg = MyConfigBuilder(4, schema, makeDocTypeRepo(true)).addAttribute().
addRankProfile().
addRankingConstant().
+ addRankingExpression().
addOnnxModel().
addImportedField().
addSummary(true).
@@ -180,6 +188,7 @@ struct DelayAttributeAspectFixture {
build();
noAttrCfg = MyConfigBuilder(4, schema, makeDocTypeRepo(hasDocField)).addRankProfile().
addRankingConstant().
+ addRankingExpression().
addOnnxModel().
addImportedField().
addSummary(hasDocField).