diff options
author | Tor Egge <Tor.Egge@yahooinc.com> | 2023-05-08 18:20:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 18:20:23 +0200 |
commit | f7692f30240fd7e10f145aaa522194f926683d71 (patch) | |
tree | e2f54ca525da9a1ff2388c6079385c11cfcb775f | |
parent | bd4a0c0ffd166d9b84e0bde051d553b059dfc2f5 (diff) | |
parent | e03abf2662f431952e0d175ad7e85a427b1a63ee (diff) |
Merge pull request #27034 from vespa-engine/toregge/move-ranking-config-to-configdefinitions
Move ranking config to configdefinitions module
39 files changed, 135 insertions, 130 deletions
diff --git a/configdefinitions/src/vespa/CMakeLists.txt b/configdefinitions/src/vespa/CMakeLists.txt index 2894c8c38b1..4512348b887 100644 --- a/configdefinitions/src/vespa/CMakeLists.txt +++ b/configdefinitions/src/vespa/CMakeLists.txt @@ -74,3 +74,9 @@ 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/vespa/searchcore/config/onnx-models.def b/configdefinitions/src/vespa/onnx-models.def index b8f5d319075..b8f5d319075 100644 --- a/searchcore/src/vespa/searchcore/config/onnx-models.def +++ b/configdefinitions/src/vespa/onnx-models.def diff --git a/searchcore/src/vespa/searchcore/config/ranking-constants.def b/configdefinitions/src/vespa/ranking-constants.def index 26dfa564a85..26dfa564a85 100644 --- a/searchcore/src/vespa/searchcore/config/ranking-constants.def +++ b/configdefinitions/src/vespa/ranking-constants.def diff --git a/searchcore/src/vespa/searchcore/config/ranking-expressions.def b/configdefinitions/src/vespa/ranking-expressions.def index a9401a4bccb..a9401a4bccb 100644 --- a/searchcore/src/vespa/searchcore/config/ranking-expressions.def +++ b/configdefinitions/src/vespa/ranking-expressions.def diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp index 0462c385e62..bbac0f9268f 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<matching::RankingConstants>(), - std::make_shared<matching::RankingExpressions>(), - std::make_shared<matching::OnnxModels>(), + std::make_shared<search::fef::RankingConstants>(), + std::make_shared<search::fef::RankingExpressions>(), + std::make_shared<search::fef::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 deba3925eb1..d80604919de 100644 --- a/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp +++ b/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp @@ -4,7 +4,10 @@ #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> @@ -13,14 +16,11 @@ #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 proton::matching::IRankingAssetsRepo; -using proton::matching::RankingExpressions; -using proton::matching::OnnxModels; +using search::fef::IRankingAssetsRepo; +using search::fef::OnnxModels; +using search::fef::RankingExpressions; 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 e0307777c4c..4af98801e92 100644 --- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp +++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp @@ -18,7 +18,6 @@ #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> @@ -35,6 +34,7 @@ #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,6 +58,7 @@ 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 c7e060a9269..5e80091aec5 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 proton::matching::RankingConstants; -using proton::matching::RankingExpressions; -using proton::matching::OnnxModels; +using search::fef::OnnxModels; +using search::fef::RankingConstants; +using search::fef::RankingExpressions; 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 99915a1b50f..db2675a7779 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 proton::matching::RankingConstants; -using proton::matching::RankingExpressions; -using proton::matching::OnnxModels; +using search::fef::OnnxModels; +using search::fef::RankingConstants; +using search::fef::RankingExpressions; 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 39b06906a91..611a1c9b54c 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 proton::matching; +using namespace search::fef; 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 60c60f0a37e..f2e3aa4f1dd 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,14 +3,17 @@ #include <vespa/eval/eval/value_cache/constant_value.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/fef/onnx_models.h> +#include <vespa/searchlib/fef/ranking_expressions.h> using namespace proton::matching; using search::fef::FieldInfo; using search::fef::FieldType; -using search::fef::Properties; +using search::fef::IRankingAssetsRepo; using search::fef::OnnxModel; +using search::fef::OnnxModels; +using search::fef::Properties; +using search::fef::RankingExpressions; 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 4ad386afa3f..d5241f7d65b 100644 --- a/searchcore/src/tests/proton/matching/matching_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_test.cpp @@ -3,7 +3,6 @@ #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> @@ -20,6 +19,7 @@ #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 proton::matching::IRankingAssetsRepo { +struct EmptyRankingAssetsRepo : public search::fef::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 13371521718..caedd363481 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,5 +1,15 @@ // 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> @@ -10,9 +20,6 @@ #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> @@ -20,13 +27,6 @@ #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 51008e4cbee..d8dafd1c39e 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 proton::matching::RankingConstants; -using proton::matching::RankingExpressions; -using proton::matching::OnnxModels; +using search::fef::OnnxModels; +using search::fef::RankingConstants; +using search::fef::RankingExpressions; 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 aebfe23aa6f..9d86b2d28e1 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<proton::matching::RankingConstants>(), - std::make_shared<proton::matching::RankingExpressions>(), - std::make_shared<proton::matching::OnnxModels>(), + std::make_shared<search::fef::RankingConstants>(), + std::make_shared<search::fef::RankingExpressions>(), + std::make_shared<search::fef::OnnxModels>(), indexschema, attributes, summary, diff --git a/searchcore/src/vespa/searchcore/config/CMakeLists.txt b/searchcore/src/vespa/searchcore/config/CMakeLists.txt index 7069521ba6e..978969bbf27 100644 --- a/searchcore/src/vespa/searchcore/config/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/config/CMakeLists.txt @@ -5,10 +5,4 @@ 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/proton/matching/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt index 9a536a0d172..7960d1d51b5 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/proton/matching/CMakeLists.txt @@ -3,7 +3,6 @@ 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 @@ -21,15 +20,12 @@ 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/indexenvironment.h b/searchcore/src/vespa/searchcore/proton/matching/indexenvironment.h index 8f8ac516ab8..1fa6c7c3917 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 "i_ranking_assets_repo.h" +#include <vespa/searchlib/fef/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 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 search::fef::IRankingAssetsRepo& _rankingAssetsRepo; + uint32_t _distributionKey; /** @@ -50,7 +50,7 @@ public: IndexEnvironment(uint32_t distributionKey, const search::index::Schema &schema, search::fef::Properties props, - const IRankingAssetsRepo &constantValueRepo); + const search::fef::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 b393558638d..657f3d11e76 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 IRankingAssetsRepo &rankingAssetsRepo, uint32_t distributionKey) + QueryLimiter &queryLimiter, const search::fef::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 6507ffca2eb..198334e4021 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.h +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.h @@ -2,7 +2,6 @@ #pragma once -#include "i_ranking_assets_repo.h" #include "docsum_matcher.h" #include "indexenvironment.h" #include "matching_stats.h" @@ -10,10 +9,11 @@ #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 IRankingAssetsRepo &rankingAssetsRepo, uint32_t distributionKey); + const search::fef::IRankingAssetsRepo &rankingAssetsRepo, uint32_t distributionKey); const search::fef::IIndexEnvironment &get_index_env() const { return _indexEnv; } diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp index afb61101853..00d9c194b9e 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 ed1e8fc7516..11f23cf0b66 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 = matching::RankingConstants; - using RankingExpressions = matching::RankingExpressions; - using OnnxModels = matching::OnnxModels; + using RankingConstants = search::fef::RankingConstants; + using RankingExpressions = search::fef::RankingExpressions; + using OnnxModels = search::fef::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 2c75f00a672..96f6c87890d 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/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-attributes.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; - matching::RankingConstants::SP newRankingConstants; - matching::RankingExpressions::SP newRankingExpressions; - matching::OnnxModels::SP newOnnxModels; + search::fef::RankingConstants::SP newRankingConstants; + search::fef::RankingExpressions::SP newRankingExpressions; + search::fef::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 0586451ec98..969e4b9cbdf 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/searchcore/proton/matching/ranking_expressions.h> -#include <vespa/searchcore/proton/matching/onnx_models.h> +#include <vespa/searchlib/fef/onnx_models.h> +#include <vespa/searchlib/fef/ranking_expressions.h> #include <vespa/vespalib/util/issue.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/stllike/hash_map.hpp> namespace proton { -using matching::RankingExpressions; -using matching::OnnxModels; +using search::fef::OnnxModels; +using search::fef::RankingExpressions; using matching::Matcher; using matching::MatchingStats; using namespace vespalib::make_string_short; Matchers::Matchers(const vespalib::Clock &clock, matching::QueryLimiter &queryLimiter, - const matching::RankingAssetsRepo &rankingAssetsRepo) + const search::fef::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 94a84faa7d6..81de92a406a 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/searchcore/proton/matching/ranking_assets_repo.h> +#include <vespa/searchlib/fef/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 matching::RankingAssetsRepo _ranking_assets_repo; - std::shared_ptr<matching::Matcher> _fallback; - std::shared_ptr<matching::Matcher> _default; + Map _rpmap; + const search::fef::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 matching::RankingAssetsRepo &rankingAssetsRepo); + const search::fef::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 matching::RankingAssetsRepo& get_ranking_assets_repo() const noexcept { return _ranking_assets_repo; } + const search::fef::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 8fefa53bba4..d2d7ab1ea84 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,8 +28,6 @@ using vespa::config::search::RankProfilesConfig; namespace proton { using matching::Matcher; -using matching::RankingExpressions; -using matching::OnnxModels; using ARIConfig = AttributeReprocessingInitializer::Config; @@ -117,10 +115,10 @@ SearchableDocSubDBConfigurer::createMatchers(const DocumentDBConfig& new_config_ { auto& schema = new_config_snapshot.getSchemaSP(); auto& cfg = new_config_snapshot.getRankProfilesConfig(); - matching::RankingAssetsRepo ranking_assets_repo_source(_constant_value_factory, - new_config_snapshot.getRankingConstantsSP(), - new_config_snapshot.getRankingExpressionsSP(), - new_config_snapshot.getOnnxModelsSP()); + search::fef::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 5c57afe6d63..db86321b9f3 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,16 +5,17 @@ #include <vespa/searchcore/proton/docsummary/summarymanager.h> #include <vespa/vespalib/util/varholder.h> -namespace searchcorespi { class IndexSearchable; } - -namespace proton::matching { +namespace search::fef { 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 afaf62d043c..93c5b734a35 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<matching::RankingConstants>()), - _rankingExpressions(std::make_shared<matching::RankingExpressions>()), - _onnxModels(std::make_shared<matching::OnnxModels>()), + _rankingConstants(std::make_shared<search::fef::RankingConstants>()), + _rankingExpressions(std::make_shared<search::fef::RankingExpressions>()), + _onnxModels(std::make_shared<search::fef::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 398cc0518f8..2ea9349861b 100644 --- a/searchlib/src/vespa/searchlib/fef/CMakeLists.txt +++ b/searchlib/src/vespa/searchlib/fef/CMakeLists.txt @@ -20,6 +20,7 @@ vespa_add_library(searchlib_fef OBJECT matchdatalayout.cpp objectstore.cpp onnx_model.cpp + onnx_models.cpp parameter.cpp parameterdescriptions.cpp parametervalidator.cpp @@ -29,6 +30,9 @@ 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/searchcore/src/vespa/searchcore/proton/matching/i_ranking_assets_repo.h b/searchlib/src/vespa/searchlib/fef/i_ranking_assets_repo.h index d96423bf25c..e3c1ed0d821 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/i_ranking_assets_repo.h +++ b/searchlib/src/vespa/searchlib/fef/i_ranking_assets_repo.h @@ -4,8 +4,9 @@ #include <vespa/eval/eval/value_cache/constant_value.h> -namespace search::fef { class OnnxModel; } -namespace proton::matching { +namespace search::fef { + +class OnnxModel; /** * Interface for retrieving named constants, expressions and models from ranking. diff --git a/searchlib/src/vespa/searchlib/fef/onnx_model.h b/searchlib/src/vespa/searchlib/fef/onnx_model.h index 62d12b8bcd1..345388573de 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 in the search core (matching component). + * OnnxModels config adapter. **/ class OnnxModel { private: diff --git a/searchcore/src/vespa/searchcore/proton/matching/onnx_models.cpp b/searchlib/src/vespa/searchlib/fef/onnx_models.cpp index 399e4ab0ad0..15092b604cc 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/onnx_models.cpp +++ b/searchlib/src/vespa/searchlib/fef/onnx_models.cpp @@ -3,7 +3,7 @@ #include "onnx_models.h" #include <cassert> -namespace proton::matching { +namespace search::fef { OnnxModels::OnnxModels() = default; OnnxModels::OnnxModels(OnnxModels &&) noexcept = default; diff --git a/searchcore/src/vespa/searchcore/proton/matching/onnx_models.h b/searchlib/src/vespa/searchlib/fef/onnx_models.h index 4a8bdbca3d9..c6c4a2b3fe9 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/onnx_models.h +++ b/searchlib/src/vespa/searchlib/fef/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 proton::matching { +namespace search::fef { /** * Class representing a set of configured onnx models, with full path @@ -17,7 +17,7 @@ namespace proton::matching { class OnnxModels { public: using ModelConfig = vespa::config::search::core::OnnxModelsConfig::Model; - using Model = search::fef::OnnxModel; + using Model = OnnxModel; using Vector = std::vector<Model>; private: diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.cpp b/searchlib/src/vespa/searchlib/fef/ranking_assets_repo.cpp index cfe7f836e42..6b5629ff91c 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.cpp +++ b/searchlib/src/vespa/searchlib/fef/ranking_assets_repo.cpp @@ -4,7 +4,7 @@ using vespalib::eval::ConstantValue; -namespace proton::matching { +namespace search::fef { 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 search::fef::OnnxModel * +const 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/searchlib/src/vespa/searchlib/fef/ranking_assets_repo.h index 3e502d2ef69..4e613f4bffb 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/ranking_assets_repo.h +++ b/searchlib/src/vespa/searchlib/fef/ranking_assets_repo.h @@ -8,7 +8,7 @@ #include "ranking_expressions.h" #include <vespa/eval/eval/value_cache/constant_value.h> -namespace proton::matching { +namespace search::fef { /** * 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 search::fef::OnnxModel *getOnnxModel(const vespalib::string &name) const override; + const OnnxModel *getOnnxModel(const vespalib::string &name) const override; }; } diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp b/searchlib/src/vespa/searchlib/fef/ranking_constants.cpp index 02f705ba4ea..1d0df1b8d94 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp +++ b/searchlib/src/vespa/searchlib/fef/ranking_constants.cpp @@ -2,7 +2,7 @@ #include "ranking_constants.h" -namespace proton::matching { +namespace search::fef { RankingConstants::Constant::Constant(const vespalib::string &name_in, const vespalib::string &type_in, diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h b/searchlib/src/vespa/searchlib/fef/ranking_constants.h index c527c6e5571..f42b4593f6c 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h +++ b/searchlib/src/vespa/searchlib/fef/ranking_constants.h @@ -7,10 +7,11 @@ #include <vector> #include <memory> -namespace proton::matching { +namespace search::fef { /** - * 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/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.cpp b/searchlib/src/vespa/searchlib/fef/ranking_expressions.cpp index 98b1e3ea653..2b293ea7d3f 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.cpp +++ b/searchlib/src/vespa/searchlib/fef/ranking_expressions.cpp @@ -6,9 +6,9 @@ #include <vespa/vespalib/util/size_literals.h> #include <vespa/log/log.h> -LOG_SETUP(".proton.matching.ranking_expressions"); +LOG_SETUP(".fef.ranking_expressions"); -namespace proton::matching { +namespace search::fef { namespace { diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.h b/searchlib/src/vespa/searchlib/fef/ranking_expressions.h index c228f2b92ca..317015938e6 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/ranking_expressions.h +++ b/searchlib/src/vespa/searchlib/fef/ranking_expressions.h @@ -6,7 +6,7 @@ #include <memory> #include <map> -namespace proton::matching { +namespace search::fef { /** * Class representing a collection of named ranking expressions |