diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2023-05-08 19:15:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 19:15:56 +0200 |
commit | afa043fd3f301ac12b107a722ef8aff861a0e8dc (patch) | |
tree | 8f0787e8e43ea79f5fa3072e4d19b51eb3c1b9c1 | |
parent | f7692f30240fd7e10f145aaa522194f926683d71 (diff) | |
parent | 0a187b361368673d99a465df438f206f2f66297e (diff) |
Merge pull request #27036 from vespa-engine/revert-27034-toregge/move-ranking-config-to-configdefinitions
Revert "Move ranking config to configdefinitions module"
39 files changed, 130 insertions, 135 deletions
diff --git a/configdefinitions/src/vespa/CMakeLists.txt b/configdefinitions/src/vespa/CMakeLists.txt index 4512348b887..2894c8c38b1 100644 --- a/configdefinitions/src/vespa/CMakeLists.txt +++ b/configdefinitions/src/vespa/CMakeLists.txt @@ -74,9 +74,3 @@ vespa_generate_config(configdefinitions all-clusters-bucket-spaces.def) install_config_definition(all-clusters-bucket-spaces.def vespa.config.content.all-clusters-bucket-spaces.def) vespa_generate_config(configdefinitions stateserver.def) install_config_definition(stateserver.def vespa.config.core.stateserver.def) -vespa_generate_config(configdefinitions ranking-constants.def) -install_config_definition(ranking-constants.def vespa.config.search.core.ranking-constants.def) -vespa_generate_config(configdefinitions ranking-expressions.def) -install_config_definition(ranking-expressions.def vespa.config.search.core.ranking-expressions.def) -vespa_generate_config(configdefinitions onnx-models.def) -install_config_definition(onnx-models.def vespa.config.search.core.onnx-models.def) 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/configdefinitions/src/vespa/onnx-models.def b/searchcore/src/vespa/searchcore/config/onnx-models.def index b8f5d319075..b8f5d319075 100644 --- a/configdefinitions/src/vespa/onnx-models.def +++ b/searchcore/src/vespa/searchcore/config/onnx-models.def diff --git a/configdefinitions/src/vespa/ranking-constants.def b/searchcore/src/vespa/searchcore/config/ranking-constants.def index 26dfa564a85..26dfa564a85 100644 --- a/configdefinitions/src/vespa/ranking-constants.def +++ b/searchcore/src/vespa/searchcore/config/ranking-constants.def diff --git a/configdefinitions/src/vespa/ranking-expressions.def b/searchcore/src/vespa/searchcore/config/ranking-expressions.def index a9401a4bccb..a9401a4bccb 100644 --- a/configdefinitions/src/vespa/ranking-expressions.def +++ b/searchcore/src/vespa/searchcore/config/ranking-expressions.def 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/searchlib/src/vespa/searchlib/fef/i_ranking_assets_repo.h b/searchcore/src/vespa/searchcore/proton/matching/i_ranking_assets_repo.h index e3c1ed0d821..d96423bf25c 100644 --- a/searchlib/src/vespa/searchlib/fef/i_ranking_assets_repo.h +++ b/searchcore/src/vespa/searchcore/proton/matching/i_ranking_assets_repo.h @@ -4,9 +4,8 @@ #include <vespa/eval/eval/value_cache/constant_value.h> -namespace search::fef { - -class OnnxModel; +namespace search::fef { class OnnxModel; } +namespace proton::matching { /** * Interface for retrieving named constants, expressions and models from ranking. 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/searchlib/src/vespa/searchlib/fef/onnx_models.cpp b/searchcore/src/vespa/searchcore/proton/matching/onnx_models.cpp index 15092b604cc..399e4ab0ad0 100644 --- a/searchlib/src/vespa/searchlib/fef/onnx_models.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/onnx_models.cpp @@ -3,7 +3,7 @@ #include "onnx_models.h" #include <cassert> -namespace search::fef { +namespace proton::matching { OnnxModels::OnnxModels() = default; OnnxModels::OnnxModels(OnnxModels &&) noexcept = default; diff --git a/searchlib/src/vespa/searchlib/fef/onnx_models.h b/searchcore/src/vespa/searchcore/proton/matching/onnx_models.h index c6c4a2b3fe9..4a8bdbca3d9 100644 --- a/searchlib/src/vespa/searchlib/fef/onnx_models.h +++ b/searchcore/src/vespa/searchcore/proton/matching/onnx_models.h @@ -2,13 +2,13 @@ #pragma once -#include "onnx_model.h" -#include <vespa/config-onnx-models.h> #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 search::fef { +namespace proton::matching { /** * Class representing a set of configured onnx models, with full path @@ -17,7 +17,7 @@ namespace search::fef { class OnnxModels { public: using ModelConfig = vespa::config::search::core::OnnxModelsConfig::Model; - using Model = OnnxModel; + using Model = search::fef::OnnxModel; using Vector = std::vector<Model>; private: diff --git a/searchlib/src/vespa/searchlib/fef/ranking_assets_repo.cpp b/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.cpp index 6b5629ff91c..cfe7f836e42 100644 --- a/searchlib/src/vespa/searchlib/fef/ranking_assets_repo.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.cpp @@ -4,7 +4,7 @@ using vespalib::eval::ConstantValue; -namespace search::fef { +namespace proton::matching { RankingAssetsRepo::RankingAssetsRepo(const ConstantValueFactory &factory, std::shared_ptr<const RankingConstants> constants, @@ -35,7 +35,7 @@ RankingAssetsRepo::getExpression(const vespalib::string &name) const { return _rankingExpressions ? _rankingExpressions->loadExpression(name) : ""; } -const OnnxModel * +const search::fef::OnnxModel * RankingAssetsRepo::getOnnxModel(const vespalib::string &name) const { return _onnxModels ? _onnxModels->getModel(name) : nullptr; } diff --git a/searchlib/src/vespa/searchlib/fef/ranking_assets_repo.h b/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.h index 4e613f4bffb..3e502d2ef69 100644 --- a/searchlib/src/vespa/searchlib/fef/ranking_assets_repo.h +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.h @@ -8,7 +8,7 @@ #include "ranking_expressions.h" #include <vespa/eval/eval/value_cache/constant_value.h> -namespace search::fef { +namespace proton::matching { /** * Class that provides access to a configured set of rank constant values. @@ -33,7 +33,7 @@ public: ~RankingAssetsRepo() override; vespalib::eval::ConstantValue::UP getConstant(const vespalib::string &name) const override; vespalib::string getExpression(const vespalib::string &name) const override; - const OnnxModel *getOnnxModel(const vespalib::string &name) const override; + const search::fef::OnnxModel *getOnnxModel(const vespalib::string &name) const override; }; } diff --git a/searchlib/src/vespa/searchlib/fef/ranking_constants.cpp b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp index 1d0df1b8d94..02f705ba4ea 100644 --- a/searchlib/src/vespa/searchlib/fef/ranking_constants.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp @@ -2,7 +2,7 @@ #include "ranking_constants.h" -namespace search::fef { +namespace proton::matching { RankingConstants::Constant::Constant(const vespalib::string &name_in, const vespalib::string &type_in, diff --git a/searchlib/src/vespa/searchlib/fef/ranking_constants.h b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h index f42b4593f6c..c527c6e5571 100644 --- a/searchlib/src/vespa/searchlib/fef/ranking_constants.h +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h @@ -7,11 +7,10 @@ #include <vector> #include <memory> -namespace search::fef { +namespace proton::matching { /** - * Class representing a set of configured ranking constants, with - * name, type and file path (where constant is stored). + * Class representing a set of configured ranking constants, with name, type and file path (where constant is stored). */ class RankingConstants { public: diff --git a/searchlib/src/vespa/searchlib/fef/ranking_expressions.cpp b/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.cpp index 2b293ea7d3f..98b1e3ea653 100644 --- a/searchlib/src/vespa/searchlib/fef/ranking_expressions.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.cpp @@ -6,9 +6,9 @@ #include <vespa/vespalib/util/size_literals.h> #include <vespa/log/log.h> -LOG_SETUP(".fef.ranking_expressions"); +LOG_SETUP(".proton.matching.ranking_expressions"); -namespace search::fef { +namespace proton::matching { namespace { diff --git a/searchlib/src/vespa/searchlib/fef/ranking_expressions.h b/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.h index 317015938e6..c228f2b92ca 100644 --- a/searchlib/src/vespa/searchlib/fef/ranking_expressions.h +++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.h @@ -6,7 +6,7 @@ #include <memory> #include <map> -namespace search::fef { +namespace proton::matching { /** * Class representing a collection of named ranking expressions 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>()), diff --git a/searchlib/src/vespa/searchlib/fef/CMakeLists.txt b/searchlib/src/vespa/searchlib/fef/CMakeLists.txt index 2ea9349861b..398cc0518f8 100644 --- a/searchlib/src/vespa/searchlib/fef/CMakeLists.txt +++ b/searchlib/src/vespa/searchlib/fef/CMakeLists.txt @@ -20,7 +20,6 @@ vespa_add_library(searchlib_fef OBJECT matchdatalayout.cpp objectstore.cpp onnx_model.cpp - onnx_models.cpp parameter.cpp parameterdescriptions.cpp parametervalidator.cpp @@ -30,9 +29,6 @@ vespa_add_library(searchlib_fef OBJECT query_value.cpp queryproperties.cpp rank_program.cpp - ranking_assets_repo.cpp - ranking_constants.cpp - ranking_expressions.cpp ranksetup.cpp simpletermdata.cpp simpletermfielddata.cpp diff --git a/searchlib/src/vespa/searchlib/fef/onnx_model.h b/searchlib/src/vespa/searchlib/fef/onnx_model.h index 345388573de..62d12b8bcd1 100644 --- a/searchlib/src/vespa/searchlib/fef/onnx_model.h +++ b/searchlib/src/vespa/searchlib/fef/onnx_model.h @@ -11,7 +11,7 @@ namespace search::fef { /** * Class containing configuration for a single onnx model setup. This * class is used both by the IIndexEnvironment api as well as the - * OnnxModels config adapter. + * OnnxModels config adapter in the search core (matching component). **/ class OnnxModel { private: |