summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-09-03 20:06:16 +0200
committerTor Egge <Tor.Egge@online.no>2022-09-03 20:06:16 +0200
commitbb655fa55b9962ce77dbdaa347bf0432a020068d (patch)
treed96fe17baba185b7936e243aba07f0874018a9f5
parentef44d786c39c6bb9d172e16ec9e61eaab2d99d6d (diff)
Use mostly empty summary config during replay.
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp21
2 files changed, 22 insertions, 2 deletions
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
index b88a375179a..47e9568e086 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
@@ -103,6 +103,7 @@ public:
}
MyConfigBuilder &addSummary(bool hasField) {
SummaryConfigBuilder builder;
+ builder.defaultsummaryid = 0;
builder.classes.resize(1);
builder.classes.back().id = 0;
builder.classes.back().name = "default";
@@ -142,7 +143,7 @@ struct Fixture {
replayCfg(),
nullCfg()
{
- basicCfg = MyConfigBuilder(4, schema, repo).addAttribute().addSummary(true).build();
+ basicCfg = MyConfigBuilder(4, schema, repo).addAttribute().addSummary(false).build();
fullCfg = MyConfigBuilder(4, schema, repo).addAttribute().
addRankProfile().
addRankingConstant().
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
index 8c067cfc3db..d99bdc97c90 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
@@ -216,6 +216,25 @@ emptyConfig(std::shared_ptr<Config> config)
return config;
}
+template <>
+std::shared_ptr<SummaryConfig>
+emptyConfig(std::shared_ptr<SummaryConfig> config)
+{
+ auto empty(std::make_shared<SummaryConfigBuilder>());
+ if (config) {
+ empty->usev8geopositions = config->usev8geopositions;
+ }
+ empty->defaultsummaryid = 0;
+ empty->classes.emplace_back();
+ auto& default_summary_class = empty->classes.back();
+ default_summary_class.id = 0;
+ default_summary_class.name = "default";
+ if (!config || *config != *empty) {
+ return empty;
+ }
+ return config;
+}
+
}
@@ -232,7 +251,7 @@ DocumentDBConfig::makeReplayConfig(const SP & orig)
std::make_shared<OnnxModels>(),
o._indexschema,
o._attributes,
- o._summary,
+ emptyConfig(o._summary),
std::make_shared<SummarymapConfig>(),
o._juniperrc,
o._documenttypes,