diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-02-03 16:06:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-03 16:06:47 +0100 |
commit | dd3f8501c791ff12032046907688c8f3e960cdd3 (patch) | |
tree | 489f464fc5229ce6ccad491fc41a7d72dcbcaff7 | |
parent | 7913cedf5659bc0f01666a5c5a5d6995c726cf16 (diff) | |
parent | 1411430cd6edec9bd7d5f07244ad353b1e85c619 (diff) |
Merge pull request #25863 from vespa-engine/toregge/setup-matchers-in-prepare
Create new matchers in prepare_reconfig.
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
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 f809f570e71..2263876c04e 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 @@ -143,10 +143,13 @@ SearchableDocSubDBConfigurer::reconfigureIndexSearchable() std::unique_ptr<const DocumentSubDBReconfig> SearchableDocSubDBConfigurer::prepare_reconfig(const DocumentDBConfig& new_config_snapshot, const DocumentDBConfig& old_config_snapshot, const ReconfigParams& reconfig_params) { - (void) new_config_snapshot; (void) old_config_snapshot; - (void) reconfig_params; - return std::make_unique<const DocumentSubDBReconfig>(std::shared_ptr<Matchers>()); + auto old_matchers = _searchView.get()->getMatchers(); + auto reconfig = std::make_unique<DocumentSubDBReconfig>(std::move(old_matchers)); + if (reconfig_params.shouldMatchersChange()) { + reconfig->set_matchers(createMatchers(new_config_snapshot)); + } + return reconfig; } void @@ -194,18 +197,12 @@ SearchableDocSubDBConfigurer::reconfigure(const DocumentDBConfig &newConfig, IDocumentDBReferenceResolver &resolver, const DocumentSubDBReconfig& prepared_reconfig) { - (void) prepared_reconfig; - bool shouldMatchViewChange = false; + bool shouldMatchViewChange = prepared_reconfig.has_matchers_changed(); bool shouldSearchViewChange = false; bool shouldFeedViewChange = params.shouldSchemaChange(); search::SerialNum currentSerialNum = attrSpec.getCurrentSerialNum(); SearchView::SP searchView = _searchView.get(); - Matchers::SP matchers = searchView->getMatchers(); - if (params.shouldMatchersChange()) { - Matchers::SP newMatchers = createMatchers(newConfig); - matchers = newMatchers; - shouldMatchViewChange = true; - } + auto matchers = prepared_reconfig.matchers(); IReprocessingInitializer::UP initializer; IAttributeManager::SP attrMgr = searchView->getAttributeManager(); IAttributeWriter::SP attrWriter = _feedView.get()->getAttributeWriter(); |