aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-02-03 14:14:18 +0100
committerTor Egge <Tor.Egge@online.no>2023-02-03 14:14:18 +0100
commit1411430cd6edec9bd7d5f07244ad353b1e85c619 (patch)
tree95ae96dcf665d0b057e3e807cc6bee68a7c91359
parenta2d46da96686f5fc99b881ef1d06ccd54ab9867c (diff)
Create new matchers in prepare_reconfig.
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp19
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();