summaryrefslogtreecommitdiffstats
path: root/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-05-10 15:36:35 +0200
committerTor Egge <Tor.Egge@online.no>2023-05-10 16:34:28 +0200
commit9acac81a83604abe175810aac9e4373d0a80bc0a (patch)
tree4d3b57d75074e3ceebfac1d073d2f95d2d283f00 /streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
parent0bd398da2e139bcbfbe0b7d234586cea11e20dab (diff)
Setup ranking assets repo for streaming search.
Diffstat (limited to 'streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp')
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp b/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
index 81df2b5492f..1242195c9df 100644
--- a/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/indexenvironment.cpp
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "indexenvironment.h"
+#include <vespa/searchlib/fef/i_ranking_assets_repo.h>
using namespace search::fef;
@@ -13,7 +14,8 @@ IndexEnvironment::IndexEnvironment(const ITableManager & tableManager) :
_fieldNames(),
_motivation(RANK),
_rankAttributes(),
- _dumpAttributes()
+ _dumpAttributes(),
+ _ranking_assets_repo()
{
}
@@ -50,5 +52,28 @@ IndexEnvironment::hintAttributeAccess(const string & name) const {
}
}
-} // namespace streaming
+void
+IndexEnvironment::set_ranking_assets_repo(std::shared_ptr<const IRankingAssetsRepo> ranking_assets_repo)
+{
+ _ranking_assets_repo = std::move(ranking_assets_repo);
+}
+vespalib::eval::ConstantValue::UP
+IndexEnvironment::getConstantValue(const vespalib::string& name) const
+{
+ return _ranking_assets_repo->getConstant(name);
+}
+
+vespalib::string
+IndexEnvironment::getRankingExpression(const vespalib::string& name) const
+{
+ return _ranking_assets_repo->getExpression(name);
+}
+
+const search::fef::OnnxModel*
+IndexEnvironment::getOnnxModel(const vespalib::string& name) const
+{
+ return _ranking_assets_repo->getOnnxModel(name);
+}
+
+}