diff options
Diffstat (limited to 'searchcore')
36 files changed, 542 insertions, 105 deletions
diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp index bbac0f9268f..0462c385e62 100644 --- a/searchcore/src/apps/tests/persistenceconformance_test.cpp +++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp @@ -125,9 +125,9 @@ public: return std::make_shared<DocumentDBConfig>( 1, std::make_shared<RankProfilesConfig>(), - std::make_shared<search::fef::RankingConstants>(), - std::make_shared<search::fef::RankingExpressions>(), - std::make_shared<search::fef::OnnxModels>(), + std::make_shared<matching::RankingConstants>(), + std::make_shared<matching::RankingExpressions>(), + std::make_shared<matching::OnnxModels>(), indexschema, attributes, summary, diff --git a/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp b/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp index d80604919de..deba3925eb1 100644 --- a/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp +++ b/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp @@ -4,10 +4,7 @@ #include "config-verify-ranksetup.h" #include <vespa/config-attributes.h> #include <vespa/config-indexschema.h> -#include <vespa/config-onnx-models.h> #include <vespa/config-rank-profiles.h> -#include <vespa/config-ranking-constants.h> -#include <vespa/config-ranking-expressions.h> #include <vespa/config/helper/legacy.h> #include <vespa/config/common/configcontext.h> #include <vespa/config/common/exceptions.h> @@ -16,11 +13,14 @@ #include <vespa/eval/eval/fast_value.h> #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/searchcore/proton/matching/onnx_models.h> #include <vespa/searchlib/features/setup.h> #include <vespa/searchlib/fef/fef.h> -#include <vespa/searchlib/fef/onnx_models.h> -#include <vespa/searchlib/fef/ranking_expressions.h> #include <vespa/searchlib/fef/test/plugin/setup.h> #include <vespa/config/subscription/configsubscriber.hpp> #include <vespa/vespalib/util/stringfmt.h> @@ -33,9 +33,9 @@ using config::ConfigRuntimeException; using config::ConfigSubscriber; using config::IConfigContext; using config::InvalidConfigException; -using search::fef::IRankingAssetsRepo; -using search::fef::OnnxModels; -using search::fef::RankingExpressions; +using proton::matching::IRankingAssetsRepo; +using proton::matching::RankingExpressions; +using proton::matching::OnnxModels; using vespa::config::search::AttributesConfig; using vespa::config::search::IndexschemaConfig; using vespa::config::search::RankProfilesConfig; diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp index 4af98801e92..e0307777c4c 100644 --- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp +++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp @@ -18,6 +18,7 @@ #include <vespa/searchcore/proton/index/index_writer.h> #include <vespa/searchcore/proton/index/indexmanager.h> #include <vespa/searchcore/proton/matching/querylimiter.h> +#include <vespa/searchcore/proton/matching/ranking_assets_repo.h> #include <vespa/searchcore/proton/matching/sessionmanager.h> #include <vespa/searchcore/proton/reference/dummy_gid_to_lid_change_handler.h> #include <vespa/searchcore/proton/reference/i_document_db_reference_resolver.h> @@ -34,7 +35,6 @@ #include <vespa/searchcore/proton/test/mock_summary_adapter.h> #include <vespa/searchcore/proton/test/transport_helper.h> #include <vespa/searchlib/attribute/interlock.h> -#include <vespa/searchlib/fef/ranking_assets_repo.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/transactionlog/nosyncproxy.h> #include <vespa/searchsummary/config/config-juniperrc.h> @@ -58,7 +58,6 @@ using namespace vespalib; using proton::matching::SessionManager; using search::SerialNum; -using search::fef::RankingAssetsRepo; using searchcorespi::IndexSearchable; using searchcorespi::index::IThreadingService; using proton::test::MockGidToLidChangeHandler; diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp index 5e80091aec5..c7e060a9269 100644 --- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp @@ -16,9 +16,9 @@ using namespace proton; using namespace search::index; using namespace search; using namespace vespa::config::search; -using search::fef::OnnxModels; -using search::fef::RankingConstants; -using search::fef::RankingExpressions; +using proton::matching::RankingConstants; +using proton::matching::RankingExpressions; +using proton::matching::OnnxModels; using std::make_shared; using std::shared_ptr; using document::config_builder::DocumenttypesConfigBuilderHelper; diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp index db2675a7779..99915a1b50f 100644 --- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp +++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp @@ -30,9 +30,9 @@ using namespace vespa::config::search::core; using namespace vespa::config::search; using namespace std::chrono_literals; using vespa::config::content::core::BucketspacesConfig; -using search::fef::OnnxModels; -using search::fef::RankingConstants; -using search::fef::RankingExpressions; +using proton::matching::RankingConstants; +using proton::matching::RankingExpressions; +using proton::matching::OnnxModels; using DBCM = DocumentDBConfigHelper; using DocumenttypesConfigSP = DocumentDBConfig::DocumenttypesConfigSP; diff --git a/searchcore/src/tests/proton/matching/constant_value_repo/constant_value_repo_test.cpp b/searchcore/src/tests/proton/matching/constant_value_repo/constant_value_repo_test.cpp index 611a1c9b54c..39b06906a91 100644 --- a/searchcore/src/tests/proton/matching/constant_value_repo/constant_value_repo_test.cpp +++ b/searchcore/src/tests/proton/matching/constant_value_repo/constant_value_repo_test.cpp @@ -2,10 +2,10 @@ #include <vespa/vespalib/testkit/test_kit.h> +#include <vespa/searchcore/proton/matching/ranking_assets_repo.h> #include <vespa/eval/eval/value_cache/constant_value.h> -#include <vespa/searchlib/fef/ranking_assets_repo.h> -using namespace search::fef; +using namespace proton::matching; using namespace vespalib::eval; class DoubleConstantValue : public ConstantValue { diff --git a/searchcore/src/tests/proton/matching/index_environment/index_environment_test.cpp b/searchcore/src/tests/proton/matching/index_environment/index_environment_test.cpp index f2e3aa4f1dd..60c60f0a37e 100644 --- a/searchcore/src/tests/proton/matching/index_environment/index_environment_test.cpp +++ b/searchcore/src/tests/proton/matching/index_environment/index_environment_test.cpp @@ -3,17 +3,14 @@ #include <vespa/eval/eval/value_cache/constant_value.h> #include <vespa/searchcore/proton/matching/indexenvironment.h> -#include <vespa/searchlib/fef/onnx_models.h> -#include <vespa/searchlib/fef/ranking_expressions.h> +#include <vespa/searchcore/proton/matching/ranking_expressions.h> +#include <vespa/searchcore/proton/matching/onnx_models.h> using namespace proton::matching; using search::fef::FieldInfo; using search::fef::FieldType; -using search::fef::IRankingAssetsRepo; -using search::fef::OnnxModel; -using search::fef::OnnxModels; using search::fef::Properties; -using search::fef::RankingExpressions; +using search::fef::OnnxModel; using search::index::Schema; using search::index::schema::CollectionType; using search::index::schema::DataType; diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp index d5241f7d65b..4ad386afa3f 100644 --- a/searchcore/src/tests/proton/matching/matching_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_test.cpp @@ -3,6 +3,7 @@ #include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h> #include <vespa/searchcore/proton/documentmetastore/documentmetastore.h> #include <vespa/searchcore/proton/matching/fakesearchcontext.h> +#include <vespa/searchcore/proton/matching/i_ranking_assets_repo.h> #include <vespa/searchcore/proton/matching/match_context.h> #include <vespa/searchcore/proton/matching/match_params.h> #include <vespa/searchcore/proton/matching/match_tools.h> @@ -19,7 +20,6 @@ #include <vespa/searchlib/engine/docsumrequest.h> #include <vespa/searchlib/engine/searchreply.h> #include <vespa/searchlib/engine/searchrequest.h> -#include <vespa/searchlib/fef/i_ranking_assets_repo.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/properties.h> #include <vespa/searchlib/fef/ranksetup.h> @@ -110,7 +110,7 @@ vespalib::string make_same_element_stack_dump(const vespalib::string &a1_term, c const uint32_t NUM_DOCS = 1000; -struct EmptyRankingAssetsRepo : public search::fef::IRankingAssetsRepo { +struct EmptyRankingAssetsRepo : public proton::matching::IRankingAssetsRepo { vespalib::eval::ConstantValue::UP getConstant(const vespalib::string &) const override { return {}; } diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp index caedd363481..13371521718 100644 --- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp +++ b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp @@ -1,15 +1,5 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/config-attributes.h> -#include <vespa/config-bucketspaces.h> -#include <vespa/config-imported-fields.h> -#include <vespa/config-indexschema.h> -#include <vespa/config-onnx-models.h> -#include <vespa/config-rank-profiles.h> -#include <vespa/config-ranking-constants.h> -#include <vespa/config-ranking-expressions.h> -#include <vespa/config-summary.h> -#include <vespa/config/common/configcontext.h> #include <vespa/searchcore/proton/server/bootstrapconfig.h> #include <vespa/searchcore/proton/server/bootstrapconfigmanager.h> #include <vespa/searchcore/proton/server/documentdbconfigmanager.h> @@ -20,6 +10,9 @@ #include <vespa/searchcore/proton/common/hw_info.h> #include <vespa/searchcore/proton/common/subdbtype.h> #include <vespa/searchcore/proton/test/transport_helper.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/searchsummary/config/config-juniperrc.h> #include <vespa/document/config/documenttypes_config_fwd.h> #include <vespa/document/repo/documenttyperepo.h> @@ -27,6 +20,13 @@ #include <vespa/vespalib/util/varholder.h> #include <vespa/vespalib/util/size_literals.h> #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/config/common/configcontext.h> +#include <vespa/config-bucketspaces.h> +#include <vespa/config-attributes.h> +#include <vespa/config-imported-fields.h> +#include <vespa/config-indexschema.h> +#include <vespa/config-rank-profiles.h> +#include <vespa/config-summary.h> #include <map> #include <thread> diff --git a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp index d8dafd1c39e..51008e4cbee 100644 --- a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp +++ b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp @@ -40,9 +40,9 @@ using document::DocumentTypeRepo; using search::TuneFileDocumentDB; using std::map; using search::index::Schema; -using search::fef::OnnxModels; -using search::fef::RankingConstants; -using search::fef::RankingExpressions; +using proton::matching::RankingConstants; +using proton::matching::RankingExpressions; +using proton::matching::OnnxModels; struct DBConfigFixture { using UP = std::unique_ptr<DBConfigFixture>; diff --git a/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp b/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp index 9d86b2d28e1..aebfe23aa6f 100644 --- a/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp +++ b/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp @@ -180,9 +180,9 @@ std::shared_ptr<DocumentDBConfig> make_document_db_config(std::shared_ptr<Docume return std::make_shared<DocumentDBConfig>( 1, std::make_shared<RankProfilesConfig>(), - std::make_shared<search::fef::RankingConstants>(), - std::make_shared<search::fef::RankingExpressions>(), - std::make_shared<search::fef::OnnxModels>(), + std::make_shared<proton::matching::RankingConstants>(), + std::make_shared<proton::matching::RankingExpressions>(), + std::make_shared<proton::matching::OnnxModels>(), indexschema, attributes, summary, diff --git a/searchcore/src/vespa/searchcore/config/CMakeLists.txt b/searchcore/src/vespa/searchcore/config/CMakeLists.txt index 978969bbf27..7069521ba6e 100644 --- a/searchcore/src/vespa/searchcore/config/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/config/CMakeLists.txt @@ -5,4 +5,10 @@ vespa_add_library(searchcore_fconfig STATIC ) vespa_generate_config(searchcore_fconfig proton.def) install_config_definition(proton.def vespa.config.search.core.proton.def) +vespa_generate_config(searchcore_fconfig ranking-constants.def) +install_config_definition(ranking-constants.def vespa.config.search.core.ranking-constants.def) +vespa_generate_config(searchcore_fconfig ranking-expressions.def) +install_config_definition(ranking-expressions.def vespa.config.search.core.ranking-expressions.def) +vespa_generate_config(searchcore_fconfig onnx-models.def) +install_config_definition(onnx-models.def vespa.config.search.core.onnx-models.def) vespa_generate_config(searchcore_fconfig hwinfo.def) diff --git a/searchcore/src/vespa/searchcore/config/onnx-models.def b/searchcore/src/vespa/searchcore/config/onnx-models.def new file mode 100644 index 00000000000..b8f5d319075 --- /dev/null +++ b/searchcore/src/vespa/searchcore/config/onnx-models.def @@ -0,0 +1,15 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=vespa.config.search.core + +model[].name string +model[].fileref file +model[].input[].name string +model[].input[].source string +model[].output[].name string +model[].output[].as string +model[].dry_run_on_setup bool default=false +model[].stateless_execution_mode string default="" +model[].stateless_interop_threads int default=-1 +model[].stateless_intraop_threads int default=-1 +model[].gpu_device int default=-1 +model[].gpu_device_required bool default=false diff --git a/searchcore/src/vespa/searchcore/config/ranking-constants.def b/searchcore/src/vespa/searchcore/config/ranking-constants.def new file mode 100644 index 00000000000..26dfa564a85 --- /dev/null +++ b/searchcore/src/vespa/searchcore/config/ranking-constants.def @@ -0,0 +1,6 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=vespa.config.search.core + +constant[].name string +constant[].fileref file +constant[].type string diff --git a/searchcore/src/vespa/searchcore/config/ranking-expressions.def b/searchcore/src/vespa/searchcore/config/ranking-expressions.def new file mode 100644 index 00000000000..a9401a4bccb --- /dev/null +++ b/searchcore/src/vespa/searchcore/config/ranking-expressions.def @@ -0,0 +1,5 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +namespace=vespa.config.search.core + +expression[].name string +expression[].fileref file diff --git a/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt index 7960d1d51b5..9a536a0d172 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt @@ -3,6 +3,7 @@ vespa_add_library(searchcore_matching STATIC SOURCES attribute_limiter.cpp blueprintbuilder.cpp + ranking_assets_repo.cpp docid_range_scheduler.cpp docsum_matcher.cpp document_scorer.cpp @@ -20,12 +21,15 @@ vespa_add_library(searchcore_matching STATIC match_tools.cpp matcher.cpp matching_stats.cpp + onnx_models.cpp partial_result.cpp query.cpp queryenvironment.cpp querylimiter.cpp querynodes.cpp rangequerylocator.cpp + ranking_constants.cpp + ranking_expressions.cpp requestcontext.cpp resolveviewvisitor.cpp result_processor.cpp diff --git a/searchcore/src/vespa/searchcore/proton/matching/i_ranking_assets_repo.h b/searchcore/src/vespa/searchcore/proton/matching/i_ranking_assets_repo.h new file mode 100644 index 00000000000..d96423bf25c --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/matching/i_ranking_assets_repo.h @@ -0,0 +1,21 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include <vespa/eval/eval/value_cache/constant_value.h> + +namespace search::fef { class OnnxModel; } +namespace proton::matching { + +/** + * Interface for retrieving named constants, expressions and models from ranking. + * Empty strings or nullptrs indicates nothing found. + */ +struct IRankingAssetsRepo { + virtual vespalib::eval::ConstantValue::UP getConstant(const vespalib::string &name) const = 0; + virtual vespalib::string getExpression(const vespalib::string &name) const = 0; + virtual const search::fef::OnnxModel *getOnnxModel(const vespalib::string &name) const = 0; + virtual ~IRankingAssetsRepo() = default; +}; + +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/indexenvironment.h b/searchcore/src/vespa/searchcore/proton/matching/indexenvironment.h index 1fa6c7c3917..8f8ac516ab8 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/indexenvironment.h +++ b/searchcore/src/vespa/searchcore/proton/matching/indexenvironment.h @@ -2,7 +2,7 @@ #pragma once -#include <vespa/searchlib/fef/i_ranking_assets_repo.h> +#include "i_ranking_assets_repo.h" #include <vespa/searchlib/fef/fieldinfo.h> #include <vespa/searchlib/fef/iindexenvironment.h> #include <vespa/searchlib/fef/properties.h> @@ -19,13 +19,13 @@ class IndexEnvironment : public search::fef::IIndexEnvironment { private: using FieldNameMap = vespalib::hash_map<string, uint32_t>; - search::fef::TableManager _tableManager; - search::fef::Properties _properties; - FieldNameMap _fieldNames; - std::vector<search::fef::FieldInfo> _fields; - mutable FeatureMotivation _motivation; - const search::fef::IRankingAssetsRepo& _rankingAssetsRepo; - uint32_t _distributionKey; + search::fef::TableManager _tableManager; + search::fef::Properties _properties; + FieldNameMap _fieldNames; + std::vector<search::fef::FieldInfo> _fields; + mutable FeatureMotivation _motivation; + const IRankingAssetsRepo &_rankingAssetsRepo; + uint32_t _distributionKey; /** @@ -50,7 +50,7 @@ public: IndexEnvironment(uint32_t distributionKey, const search::index::Schema &schema, search::fef::Properties props, - const search::fef::IRankingAssetsRepo& constantValueRepo); + const IRankingAssetsRepo &constantValueRepo); ~IndexEnvironment() override; diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index 657f3d11e76..b393558638d 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -103,7 +103,7 @@ handleGroupingSession(SessionManager &sessionMgr, GroupingContext & groupingCont } // namespace proton::matching::<unnamed> Matcher::Matcher(const search::index::Schema &schema, Properties props, const vespalib::Clock &clock, - QueryLimiter &queryLimiter, const search::fef::IRankingAssetsRepo &rankingAssetsRepo, uint32_t distributionKey) + QueryLimiter &queryLimiter, const IRankingAssetsRepo &rankingAssetsRepo, uint32_t distributionKey) : _indexEnv(distributionKey, schema, std::move(props), rankingAssetsRepo), _blueprintFactory(), _rankSetup(), diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.h b/searchcore/src/vespa/searchcore/proton/matching/matcher.h index 198334e4021..6507ffca2eb 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.h +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.h @@ -2,6 +2,7 @@ #pragma once +#include "i_ranking_assets_repo.h" #include "docsum_matcher.h" #include "indexenvironment.h" #include "matching_stats.h" @@ -9,11 +10,10 @@ #include "search_session.h" #include "viewresolver.h" #include <vespa/searchcommon/attribute/i_attribute_functor.h> +#include <vespa/searchlib/fef/blueprintfactory.h> #include <vespa/searchlib/common/matching_elements_fields.h> #include <vespa/searchlib/common/matching_elements.h> #include <vespa/searchlib/common/resultset.h> -#include <vespa/searchlib/fef/blueprintfactory.h> -#include <vespa/searchlib/fef/i_ranking_assets_repo.h> #include <vespa/searchlib/queryeval/blueprint.h> #include <vespa/searchlib/query/base.h> #include <vespa/vespalib/util/clock.h> @@ -86,7 +86,7 @@ public: **/ Matcher(const search::index::Schema &schema, Properties props, const vespalib::Clock &clock, QueryLimiter &queryLimiter, - const search::fef::IRankingAssetsRepo &rankingAssetsRepo, uint32_t distributionKey); + const IRankingAssetsRepo &rankingAssetsRepo, uint32_t distributionKey); const search::fef::IIndexEnvironment &get_index_env() const { return _indexEnv; } diff --git a/searchcore/src/vespa/searchcore/proton/matching/onnx_models.cpp b/searchcore/src/vespa/searchcore/proton/matching/onnx_models.cpp new file mode 100644 index 00000000000..399e4ab0ad0 --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/matching/onnx_models.cpp @@ -0,0 +1,49 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "onnx_models.h" +#include <cassert> + +namespace proton::matching { + +OnnxModels::OnnxModels() = default; +OnnxModels::OnnxModels(OnnxModels &&) noexcept = default; +OnnxModels::~OnnxModels() = default; + +OnnxModels::OnnxModels(Vector models) + : _models() +{ + for (auto &model: models) { + _models.emplace(model.name(), std::move(model)); + } +} + +bool +OnnxModels::operator==(const OnnxModels &rhs) const +{ + return (_models == rhs._models); +} + +const OnnxModels::Model * +OnnxModels::getModel(const vespalib::string &name) const +{ + auto itr = _models.find(name); + if (itr != _models.end()) { + return &itr->second; + } + return nullptr; +} + +void +OnnxModels::configure(const ModelConfig &config, Model &model) +{ + assert(config.name == model.name()); + for (const auto &input: config.input) { + model.input_feature(input.name, input.source); + } + for (const auto &output: config.output) { + model.output_name(output.name, output.as); + } + model.dry_run_on_setup(config.dryRunOnSetup); +} + +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/onnx_models.h b/searchcore/src/vespa/searchcore/proton/matching/onnx_models.h new file mode 100644 index 00000000000..4a8bdbca3d9 --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/matching/onnx_models.h @@ -0,0 +1,42 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include <vespa/vespalib/stllike/string.h> +#include <vespa/searchlib/fef/onnx_model.h> +#include <vespa/searchcore/config/config-onnx-models.h> +#include <map> +#include <vector> + +namespace proton::matching { + +/** + * Class representing a set of configured onnx models, with full path + * for where the models are stored on disk. + */ +class OnnxModels { +public: + using ModelConfig = vespa::config::search::core::OnnxModelsConfig::Model; + using Model = search::fef::OnnxModel; + using Vector = std::vector<Model>; + +private: + using Map = std::map<vespalib::string, Model>; + Map _models; + +public: + using SP = std::shared_ptr<OnnxModels>; + OnnxModels(); + OnnxModels(Vector models); + OnnxModels(OnnxModels &&) noexcept; + OnnxModels & operator=(OnnxModels &&) = delete; + OnnxModels(const OnnxModels &) = delete; + OnnxModels & operator =(const OnnxModels &) = delete; + ~OnnxModels(); + bool operator==(const OnnxModels &rhs) const; + [[nodiscard]] const Model *getModel(const vespalib::string &name) const; + [[nodiscard]] size_t size() const { return _models.size(); } + static void configure(const ModelConfig &config, Model &model); +}; + +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.cpp b/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.cpp new file mode 100644 index 00000000000..cfe7f836e42 --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.cpp @@ -0,0 +1,43 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "ranking_assets_repo.h" + +using vespalib::eval::ConstantValue; + +namespace proton::matching { + +RankingAssetsRepo::RankingAssetsRepo(const ConstantValueFactory &factory, + std::shared_ptr<const RankingConstants> constants, + std::shared_ptr<const RankingExpressions> expressions, + std::shared_ptr<const OnnxModels> models) + : _factory(factory), + _constants(std::move(constants)), + _rankingExpressions(std::move(expressions)), + _onnxModels(std::move(models)) +{ +} + +RankingAssetsRepo::~RankingAssetsRepo() = default; + +ConstantValue::UP +RankingAssetsRepo::getConstant(const vespalib::string &name) const +{ + if ( ! _constants) return {}; + const RankingConstants::Constant *constant = _constants->getConstant(name); + if (constant != nullptr) { + return _factory.create(constant->filePath, constant->type); + } + return {}; +} + +vespalib::string +RankingAssetsRepo::getExpression(const vespalib::string &name) const { + return _rankingExpressions ? _rankingExpressions->loadExpression(name) : ""; +} + +const search::fef::OnnxModel * +RankingAssetsRepo::getOnnxModel(const vespalib::string &name) const { + return _onnxModels ? _onnxModels->getModel(name) : nullptr; +} + +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.h b/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.h new file mode 100644 index 00000000000..3e502d2ef69 --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.h @@ -0,0 +1,39 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include "i_ranking_assets_repo.h" +#include "ranking_constants.h" +#include "onnx_models.h" +#include "ranking_expressions.h" +#include <vespa/eval/eval/value_cache/constant_value.h> + +namespace proton::matching { + +/** + * Class that provides access to a configured set of rank constant values. + * + * This class maps symbolic names to assets used while setting up rank features blueprints. + * A factory is used to instantiate constant values. + */ +class RankingAssetsRepo : public IRankingAssetsRepo { +private: + using ConstantValueFactory = vespalib::eval::ConstantValueFactory; + + const ConstantValueFactory &_factory; + const std::shared_ptr<const RankingConstants> _constants; + const std::shared_ptr<const RankingExpressions> _rankingExpressions; + const std::shared_ptr<const OnnxModels> _onnxModels; + +public: + RankingAssetsRepo(const ConstantValueFactory &factory, + std::shared_ptr<const RankingConstants> constants, + std::shared_ptr<const RankingExpressions> expressions, + std::shared_ptr<const OnnxModels> models); + ~RankingAssetsRepo() override; + vespalib::eval::ConstantValue::UP getConstant(const vespalib::string &name) const override; + vespalib::string getExpression(const vespalib::string &name) const override; + const search::fef::OnnxModel *getOnnxModel(const vespalib::string &name) const override; +}; + +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp new file mode 100644 index 00000000000..02f705ba4ea --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp @@ -0,0 +1,59 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "ranking_constants.h" + +namespace proton::matching { + +RankingConstants::Constant::Constant(const vespalib::string &name_in, + const vespalib::string &type_in, + const vespalib::string &filePath_in) + : name(name_in), + type(type_in), + filePath(filePath_in) +{ +} + +RankingConstants::Constant::~Constant() = default; + +bool +RankingConstants::Constant::operator==(const Constant &rhs) const +{ + return (name == rhs.name) && + (type == rhs.type) && + (filePath == rhs.filePath); +} + +RankingConstants::RankingConstants() + : _constants() +{ +} + +RankingConstants::~RankingConstants() = default; +RankingConstants::RankingConstants(RankingConstants &&) noexcept = default; + +RankingConstants::RankingConstants(const Vector &constants) + : _constants() +{ + for (const auto &constant : constants) { + _constants.insert(std::make_pair(constant.name, constant)); + } +} + +bool +RankingConstants::operator==(const RankingConstants &rhs) const +{ + return _constants == rhs._constants; +} + +const RankingConstants::Constant * +RankingConstants::getConstant(const vespalib::string &name) const +{ + auto itr = _constants.find(name); + if (itr != _constants.end()) { + return &itr->second; + } + return nullptr; +} + +} + diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h new file mode 100644 index 00000000000..c527c6e5571 --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h @@ -0,0 +1,49 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include <vespa/vespalib/stllike/string.h> +#include <map> +#include <vector> +#include <memory> + +namespace proton::matching { + +/** + * Class representing a set of configured ranking constants, with name, type and file path (where constant is stored). + */ +class RankingConstants { +public: + struct Constant { + vespalib::string name; + vespalib::string type; + vespalib::string filePath; + + Constant(const vespalib::string &name_in, + const vespalib::string &type_in, + const vespalib::string &filePath_in); + ~Constant(); + bool operator==(const Constant &rhs) const; + }; + + using Vector = std::vector<Constant>; + +private: + using Map = std::map<vespalib::string, Constant>; + Map _constants; + +public: + using SP = std::shared_ptr<RankingConstants>; + RankingConstants(); + RankingConstants(RankingConstants &&) noexcept; + RankingConstants & operator =(RankingConstants &&) = delete; + RankingConstants(const RankingConstants &) = delete; + RankingConstants & operator =(const RankingConstants &) = delete; + explicit RankingConstants(const Vector &constants); + ~RankingConstants(); + bool operator==(const RankingConstants &rhs) const; + const Constant *getConstant(const vespalib::string &name) const; + size_t size() const { return _constants.size(); } +}; + +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.cpp b/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.cpp new file mode 100644 index 00000000000..98b1e3ea653 --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.cpp @@ -0,0 +1,65 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "ranking_expressions.h" +#include <vespa/vespalib/io/mapped_file_input.h> +#include <vespa/vespalib/data/lz4_input_decoder.h> +#include <vespa/vespalib/util/size_literals.h> + +#include <vespa/log/log.h> +LOG_SETUP(".proton.matching.ranking_expressions"); + +namespace proton::matching { + +namespace { + +vespalib::string extract_data(vespalib::Input &input) { + vespalib::string result; + for (auto chunk = input.obtain(); chunk.size > 0; chunk = input.obtain()) { + result.append(vespalib::stringref(chunk.data, chunk.size)); + input.evict(chunk.size); + } + return result; +} + +} // unnamed + +RankingExpressions::RankingExpressions() = default; +RankingExpressions::RankingExpressions(RankingExpressions &&rhs) noexcept = default; +RankingExpressions::~RankingExpressions() = default; + +RankingExpressions & +RankingExpressions::add(const vespalib::string &name, const vespalib::string &path) +{ + _expressions.insert_or_assign(name, path); + return *this; +} + +vespalib::string +RankingExpressions::loadExpression(const vespalib::string &name) const +{ + auto pos = _expressions.find(name); + if (pos == _expressions.end()) { + LOG(warning, "no such ranking expression: '%s'", name.c_str()); + return {}; + } + auto path = pos->second; + vespalib::MappedFileInput file(path); + if (!file.valid()) { + LOG(warning, "rankexpression: %s -> could not read file: %s", name.c_str(), path.c_str()); + return {}; + } + if (ends_with(path, ".lz4")) { + size_t buffer_size = 64_Ki; + vespalib::Lz4InputDecoder lz4_decoder(file, buffer_size); + auto result = extract_data(lz4_decoder); + if (lz4_decoder.failed()) { + LOG(warning, "file contains lz4 errors (%s): %s", + lz4_decoder.reason().c_str(), path.c_str()); + return {}; + } + return result; + } + return extract_data(file); +} + +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.h b/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.h new file mode 100644 index 00000000000..c228f2b92ca --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.h @@ -0,0 +1,37 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include <vespa/vespalib/stllike/string.h> +#include <memory> +#include <map> + +namespace proton::matching { + +/** + * Class representing a collection of named ranking expressions + * obtained through file-distribution. + */ +class RankingExpressions +{ +private: + // expression name -> full_path of expression file + std::map<vespalib::string,vespalib::string> _expressions; + +public: + using SP = std::shared_ptr<RankingExpressions>; + RankingExpressions(); + RankingExpressions(RankingExpressions &&rhs) noexcept; + RankingExpressions & operator=(RankingExpressions &&rhs) = delete; + RankingExpressions(const RankingExpressions &rhs) = delete; + RankingExpressions & operator=(const RankingExpressions &rhs) = delete; + ~RankingExpressions(); + bool operator==(const RankingExpressions &rhs) const { + return _expressions == rhs._expressions; + } + size_t size() const { return _expressions.size(); } + RankingExpressions &add(const vespalib::string &name, const vespalib::string &path); + vespalib::string loadExpression(const vespalib::string &name) const; +}; + +} diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp index 00d9c194b9e..afb61101853 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp @@ -4,15 +4,15 @@ #include "threading_service_config.h" #include <vespa/config-attributes.h> #include <vespa/config-imported-fields.h> -#include <vespa/config-onnx-models.h> #include <vespa/config-rank-profiles.h> -#include <vespa/config-ranking-constants.h> #include <vespa/config-summary.h> #include <vespa/searchsummary/config/config-juniperrc.h> #include <vespa/document/config/documenttypes_config_fwd.h> #include <vespa/document/config/config-documenttypes.h> #include <vespa/document/repo/documenttyperepo.h> #include <vespa/searchcommon/common/schemaconfigurer.h> +#include <vespa/searchcore/config/config-ranking-constants.h> +#include <vespa/searchcore/config/config-onnx-models.h> #include <vespa/searchcore/proton/attribute/attribute_aspect_delayer.h> #include <vespa/searchcore/proton/common/alloc_config.h> #include <vespa/searchcore/proton/common/document_type_inspector.h> diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h index 11f23cf0b66..ed1e8fc7516 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h @@ -5,11 +5,11 @@ #include "document_db_maintenance_config.h" #include "threading_service_config.h" #include <vespa/searchcore/proton/common/alloc_config.h> +#include <vespa/searchcore/proton/matching/ranking_constants.h> +#include <vespa/searchcore/proton/matching/ranking_expressions.h> +#include <vespa/searchcore/proton/matching/onnx_models.h> #include <vespa/searchlib/common/tunefileinfo.h> #include <vespa/searchlib/docstore/logdocumentstore.h> -#include <vespa/searchlib/fef/onnx_models.h> -#include <vespa/searchlib/fef/ranking_constants.h> -#include <vespa/searchlib/fef/ranking_expressions.h> #include <vespa/searchcommon/common/schema.h> #include <vespa/document/config/documenttypes_config_fwd.h> @@ -98,9 +98,9 @@ public: using AttributesConfigSP = std::shared_ptr<AttributesConfig>; using RankProfilesConfig = const vespa::config::search::internal::InternalRankProfilesType; using RankProfilesConfigSP = std::shared_ptr<RankProfilesConfig>; - using RankingConstants = search::fef::RankingConstants; - using RankingExpressions = search::fef::RankingExpressions; - using OnnxModels = search::fef::OnnxModels; + using RankingConstants = matching::RankingConstants; + using RankingExpressions = matching::RankingExpressions; + using OnnxModels = matching::OnnxModels; using SummaryConfig = const vespa::config::search::internal::InternalSummaryType; using SummaryConfigSP = std::shared_ptr<SummaryConfig>; using JuniperrcConfig = const vespa::config::search::summary::internal::InternalJuniperrcType; diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp index 96f6c87890d..2c75f00a672 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp @@ -3,22 +3,22 @@ #include "documentdbconfigmanager.h" #include "bootstrapconfig.h" #include "threading_service_config.h" -#include <vespa/config-attributes.h> +#include <vespa/searchcore/proton/common/alloc_config.h> +#include <vespa/searchcore/proton/common/hw_info.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/config/common/exceptions.h> #include <vespa/config-imported-fields.h> -#include <vespa/config-indexschema.h> -#include <vespa/config-onnx-models.h> #include <vespa/config-rank-profiles.h> -#include <vespa/config-ranking-constants.h> -#include <vespa/config-ranking-expressions.h> -#include <vespa/config-summary.h> -#include <vespa/config/common/exceptions.h> #include <vespa/config/file_acquirer/file_acquirer.h> #include <vespa/config/common/configcontext.h> #include <vespa/config/retriever/configretriever.h> #include <vespa/config/helper/legacy.h> +#include <vespa/config-attributes.h> +#include <vespa/config-indexschema.h> +#include <vespa/config-summary.h> #include <vespa/searchcommon/common/schemaconfigurer.h> -#include <vespa/searchcore/proton/common/alloc_config.h> -#include <vespa/searchcore/proton/common/hw_info.h> #include <vespa/searchlib/index/schemautil.h> #include <vespa/searchsummary/config/config-juniperrc.h> #include <vespa/vespalib/time/time_box.h> @@ -38,11 +38,11 @@ using namespace vespa::config::search; using document::DocumentTypeRepo; using search::TuneFileDocumentDB; -using search::fef::OnnxModels; -using search::fef::RankingConstants; -using search::fef::RankingExpressions; using search::index::Schema; using search::index::SchemaBuilder; +using proton::matching::RankingConstants; +using proton::matching::RankingExpressions; +using proton::matching::OnnxModels; using vespalib::compression::CompressionConfig; using search::LogDocumentStore; using search::LogDataStore; @@ -275,9 +275,9 @@ DocumentDBConfigManager::update(FNET_Transport & transport, const ConfigSnapshot DocumentDBConfig::SP current = _pendingConfigSnapshot; RankProfilesConfigSP newRankProfilesConfig; - search::fef::RankingConstants::SP newRankingConstants; - search::fef::RankingExpressions::SP newRankingExpressions; - search::fef::OnnxModels::SP newOnnxModels; + matching::RankingConstants::SP newRankingConstants; + matching::RankingExpressions::SP newRankingExpressions; + matching::OnnxModels::SP newOnnxModels; IndexschemaConfigSP newIndexschemaConfig; MaintenanceConfigSP oldMaintenanceConfig; MaintenanceConfigSP newMaintenanceConfig; diff --git a/searchcore/src/vespa/searchcore/proton/server/matchers.cpp b/searchcore/src/vespa/searchcore/proton/server/matchers.cpp index 969e4b9cbdf..0586451ec98 100644 --- a/searchcore/src/vespa/searchcore/proton/server/matchers.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/matchers.cpp @@ -2,23 +2,23 @@ #include "matchers.h" #include <vespa/searchcore/proton/matching/matcher.h> -#include <vespa/searchlib/fef/onnx_models.h> -#include <vespa/searchlib/fef/ranking_expressions.h> +#include <vespa/searchcore/proton/matching/ranking_expressions.h> +#include <vespa/searchcore/proton/matching/onnx_models.h> #include <vespa/vespalib/util/issue.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/stllike/hash_map.hpp> namespace proton { -using search::fef::OnnxModels; -using search::fef::RankingExpressions; +using matching::RankingExpressions; +using matching::OnnxModels; using matching::Matcher; using matching::MatchingStats; using namespace vespalib::make_string_short; Matchers::Matchers(const vespalib::Clock &clock, matching::QueryLimiter &queryLimiter, - const search::fef::RankingAssetsRepo &rankingAssetsRepo) + const matching::RankingAssetsRepo &rankingAssetsRepo) : _rpmap(), _ranking_assets_repo(rankingAssetsRepo), _fallback(std::make_shared<Matcher>(search::index::Schema(), search::fef::Properties(), clock, queryLimiter, diff --git a/searchcore/src/vespa/searchcore/proton/server/matchers.h b/searchcore/src/vespa/searchcore/proton/server/matchers.h index 81de92a406a..94a84faa7d6 100644 --- a/searchcore/src/vespa/searchcore/proton/server/matchers.h +++ b/searchcore/src/vespa/searchcore/proton/server/matchers.h @@ -3,7 +3,7 @@ #pragma once #include <vespa/searchcore/proton/matching/matching_stats.h> -#include <vespa/searchlib/fef/ranking_assets_repo.h> +#include <vespa/searchcore/proton/matching/ranking_assets_repo.h> #include <vespa/vespalib/stllike/hash_map.h> namespace vespalib { class Clock; } @@ -18,15 +18,15 @@ namespace matching { class Matchers { private: using Map = vespalib::hash_map<vespalib::string, std::shared_ptr<matching::Matcher>>; - Map _rpmap; - const search::fef::RankingAssetsRepo _ranking_assets_repo; - std::shared_ptr<matching::Matcher> _fallback; - std::shared_ptr<matching::Matcher> _default; + Map _rpmap; + const matching::RankingAssetsRepo _ranking_assets_repo; + std::shared_ptr<matching::Matcher> _fallback; + std::shared_ptr<matching::Matcher> _default; public: using SP = std::shared_ptr<Matchers>; Matchers(const vespalib::Clock &clock, matching::QueryLimiter &queryLimiter, - const search::fef::RankingAssetsRepo &rankingAssetsRepo); + const matching::RankingAssetsRepo &rankingAssetsRepo); Matchers(const Matchers &) = delete; Matchers & operator =(const Matchers &) = delete; ~Matchers(); @@ -34,7 +34,7 @@ public: matching::MatchingStats getStats() const; matching::MatchingStats getStats(const vespalib::string &name) const; std::shared_ptr<matching::Matcher> lookup(const vespalib::string &name) const; - const search::fef::RankingAssetsRepo& get_ranking_assets_repo() const noexcept { return _ranking_assets_repo; } + const matching::RankingAssetsRepo& get_ranking_assets_repo() const noexcept { return _ranking_assets_repo; } }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp index d2d7ab1ea84..8fefa53bba4 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp @@ -28,6 +28,8 @@ using vespa::config::search::RankProfilesConfig; namespace proton { using matching::Matcher; +using matching::RankingExpressions; +using matching::OnnxModels; using ARIConfig = AttributeReprocessingInitializer::Config; @@ -115,10 +117,10 @@ SearchableDocSubDBConfigurer::createMatchers(const DocumentDBConfig& new_config_ { auto& schema = new_config_snapshot.getSchemaSP(); auto& cfg = new_config_snapshot.getRankProfilesConfig(); - search::fef::RankingAssetsRepo ranking_assets_repo_source(_constant_value_factory, - new_config_snapshot.getRankingConstantsSP(), - new_config_snapshot.getRankingExpressionsSP(), - new_config_snapshot.getOnnxModelsSP()); + matching::RankingAssetsRepo ranking_assets_repo_source(_constant_value_factory, + new_config_snapshot.getRankingConstantsSP(), + new_config_snapshot.getRankingExpressionsSP(), + new_config_snapshot.getOnnxModelsSP()); auto newMatchers = std::make_shared<Matchers>(_clock, _queryLimiter, ranking_assets_repo_source); auto& ranking_assets_repo = newMatchers->get_ranking_assets_repo(); for (const auto &profile : cfg.rankprofile) { diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h index db86321b9f3..5c57afe6d63 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h @@ -5,17 +5,16 @@ #include <vespa/searchcore/proton/docsummary/summarymanager.h> #include <vespa/vespalib/util/varholder.h> -namespace search::fef { +namespace searchcorespi { class IndexSearchable; } + +namespace proton::matching { class RankingExpressions; class OnnxModels; +class QueryLimiter; } -namespace searchcorespi { class IndexSearchable; } - -namespace proton::matching { class QueryLimiter; } - namespace vespalib::eval { struct ConstantValueFactory; } namespace vespalib { class Clock; } diff --git a/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.cpp b/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.cpp index 93c5b734a35..afaf62d043c 100644 --- a/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.cpp +++ b/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.cpp @@ -31,9 +31,9 @@ DocumentDBConfigBuilder::DocumentDBConfigBuilder(int64_t generation, const vespalib::string &docTypeName) : _generation(generation), _rankProfiles(std::make_shared<RankProfilesConfig>()), - _rankingConstants(std::make_shared<search::fef::RankingConstants>()), - _rankingExpressions(std::make_shared<search::fef::RankingExpressions>()), - _onnxModels(std::make_shared<search::fef::OnnxModels>()), + _rankingConstants(std::make_shared<matching::RankingConstants>()), + _rankingExpressions(std::make_shared<matching::RankingExpressions>()), + _onnxModels(std::make_shared<matching::OnnxModels>()), _indexschema(std::make_shared<IndexschemaConfig>()), _attributes(std::make_shared<AttributesConfig>()), _summary(std::make_shared<SummaryConfig>()), |