summaryrefslogtreecommitdiffstats
path: root/searchcore/src/apps
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2021-05-20 11:42:43 +0200
committerGitHub <noreply@github.com>2021-05-20 11:42:43 +0200
commitff423f32a08d29aea73a101b7b0094b35638d697 (patch)
treed7cfe9762710cb102d28836db4ea257546257226 /searchcore/src/apps
parentad936521af553e0278d9ceb3c47b328383f34806 (diff)
Revert "external ranking expressions"
Diffstat (limited to 'searchcore/src/apps')
-rw-r--r--searchcore/src/apps/tests/persistenceconformance_test.cpp1
-rw-r--r--searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp34
-rw-r--r--searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp1
3 files changed, 5 insertions, 31 deletions
diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp
index 24db810b9df..69d509c25fd 100644
--- a/searchcore/src/apps/tests/persistenceconformance_test.cpp
+++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp
@@ -133,7 +133,6 @@ public:
1,
std::make_shared<RankProfilesConfig>(),
std::make_shared<matching::RankingConstants>(),
- std::make_shared<matching::RankingExpressions>(),
std::make_shared<matching::OnnxModels>(),
indexschema,
attributes,
diff --git a/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp b/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp
index 853395be3e1..559e8fd14cd 100644
--- a/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp
+++ b/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp
@@ -15,10 +15,8 @@
#include <vespa/eval/eval/value_codec.h>
#include <vespa/searchcommon/common/schemaconfigurer.h>
#include <vespa/searchcore/config/config-ranking-constants.h>
-#include <vespa/searchcore/config/config-ranking-expressions.h>
#include <vespa/searchcore/config/config-onnx-models.h>
#include <vespa/searchcore/proton/matching/indexenvironment.h>
-#include <vespa/searchcore/proton/matching/ranking_expressions.h>
#include <vespa/searchlib/features/setup.h>
#include <vespa/searchlib/fef/fef.h>
#include <vespa/searchlib/fef/test/plugin/setup.h>
@@ -35,13 +33,11 @@ using config::ConfigSubscriber;
using config::IConfigContext;
using config::InvalidConfigException;
using proton::matching::IConstantValueRepo;
-using proton::matching::RankingExpressions;
using proton::matching::OnnxModels;
using vespa::config::search::AttributesConfig;
using vespa::config::search::IndexschemaConfig;
using vespa::config::search::RankProfilesConfig;
using vespa::config::search::core::RankingConstantsConfig;
-using vespa::config::search::core::RankingExpressionsConfig;
using vespa::config::search::core::OnnxModelsConfig;
using vespa::config::search::core::VerifyRanksetupConfig;
using vespalib::eval::BadConstantValue;
@@ -61,19 +57,6 @@ std::optional<vespalib::string> get_file(const vespalib::string &ref, const Veri
return std::nullopt;
}
-RankingExpressions make_expressions(const RankingExpressionsConfig &expressionsCfg, const VerifyRanksetupConfig &myCfg) {
- RankingExpressions expressions;
- for (const auto &entry: expressionsCfg.expression) {
- if (auto file = get_file(entry.fileref, myCfg)) {
- expressions.add(entry.name, file.value());
- } else {
- LOG(warning, "could not find file for ranking expression '%s' (ref:'%s')",
- entry.name.c_str(), entry.fileref.c_str());
- }
- }
- return expressions;
-}
-
OnnxModels make_models(const OnnxModelsConfig &modelsCfg, const VerifyRanksetupConfig &myCfg) {
OnnxModels::Vector model_list;
for (const auto &entry: modelsCfg.model) {
@@ -81,7 +64,7 @@ OnnxModels make_models(const OnnxModelsConfig &modelsCfg, const VerifyRanksetupC
model_list.emplace_back(entry.name, file.value());
OnnxModels::configure(entry, model_list.back());
} else {
- LOG(warning, "could not find file for onnx model '%s' (ref:'%s')",
+ LOG(warning, "could not find file for onnx model '%s' (ref:'%s')\n",
entry.name.c_str(), entry.fileref.c_str());
}
}
@@ -94,15 +77,13 @@ public:
bool verify(const search::index::Schema &schema,
const search::fef::Properties &props,
const IConstantValueRepo &repo,
- const RankingExpressions &expressions,
- const OnnxModels &models);
+ OnnxModels models);
bool verifyConfig(const VerifyRanksetupConfig &myCfg,
const RankProfilesConfig &rankCfg,
const IndexschemaConfig &schemaCfg,
const AttributesConfig &attributeCfg,
const RankingConstantsConfig &constantsCfg,
- const RankingExpressionsConfig &expressionsCfg,
const OnnxModelsConfig &modelsCfg);
int usage();
@@ -131,10 +112,9 @@ bool
App::verify(const search::index::Schema &schema,
const search::fef::Properties &props,
const IConstantValueRepo &repo,
- const RankingExpressions &expressions,
- const OnnxModels &models)
+ OnnxModels models)
{
- proton::matching::IndexEnvironment indexEnv(0, schema, props, repo, expressions, models);
+ proton::matching::IndexEnvironment indexEnv(0, schema, props, repo, models);
search::fef::BlueprintFactory factory;
search::features::setup_search_features(factory);
search::fef::test::setup_fef_test_plugin(factory);
@@ -163,7 +143,6 @@ App::verifyConfig(const VerifyRanksetupConfig &myCfg,
const IndexschemaConfig &schemaCfg,
const AttributesConfig &attributeCfg,
const RankingConstantsConfig &constantsCfg,
- const RankingExpressionsConfig &expressionsCfg,
const OnnxModelsConfig &modelsCfg)
{
bool ok = true;
@@ -171,7 +150,6 @@ App::verifyConfig(const VerifyRanksetupConfig &myCfg,
search::index::SchemaBuilder::build(schemaCfg, schema);
search::index::SchemaBuilder::build(attributeCfg, schema);
DummyConstantValueRepo repo(constantsCfg);
- auto expressions = make_expressions(expressionsCfg, myCfg);
auto models = make_models(modelsCfg, myCfg);
for(size_t i = 0; i < rankCfg.rankprofile.size(); i++) {
search::fef::Properties properties;
@@ -180,7 +158,7 @@ App::verifyConfig(const VerifyRanksetupConfig &myCfg,
properties.add(profile.fef.property[j].name,
profile.fef.property[j].value);
}
- if (verify(schema, properties, repo, expressions, models)) {
+ if (verify(schema, properties, repo, models)) {
LOG(info, "rank profile '%s': pass", profile.name.c_str());
} else {
LOG(error, "rank profile '%s': FAIL", profile.name.c_str());
@@ -218,7 +196,6 @@ App::Main()
ConfigHandle<AttributesConfig>::UP attributesHandle = subscriber.subscribe<AttributesConfig>(cfgId);
ConfigHandle<IndexschemaConfig>::UP schemaHandle = subscriber.subscribe<IndexschemaConfig>(cfgId);
ConfigHandle<RankingConstantsConfig>::UP constantsHandle = subscriber.subscribe<RankingConstantsConfig>(cfgId);
- ConfigHandle<RankingExpressionsConfig>::UP expressionsHandle = subscriber.subscribe<RankingExpressionsConfig>(cfgId);
ConfigHandle<OnnxModelsConfig>::UP modelsHandle = subscriber.subscribe<OnnxModelsConfig>(cfgId);
subscriber.nextConfig();
@@ -227,7 +204,6 @@ App::Main()
*schemaHandle->getConfig(),
*attributesHandle->getConfig(),
*constantsHandle->getConfig(),
- *expressionsHandle->getConfig(),
*modelsHandle->getConfig());
} catch (ConfigRuntimeException & e) {
LOG(error, "Unable to subscribe to config: %s", e.getMessage().c_str());
diff --git a/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp b/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp
index e4dd4715ed1..6e346bcfa60 100644
--- a/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp
+++ b/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp
@@ -187,7 +187,6 @@ std::shared_ptr<DocumentDBConfig> make_document_db_config(std::shared_ptr<Docume
1,
std::make_shared<RankProfilesConfig>(),
std::make_shared<matching::RankingConstants>(),
- std::make_shared<matching::RankingExpressions>(),
std::make_shared<matching::OnnxModels>(),
indexschema,
attributes,