summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2017-04-05 12:57:05 +0200
committerGitHub <noreply@github.com>2017-04-05 12:57:05 +0200
commitb2d69832dd6b0730b1baaa8ec81a1e10354cee2d (patch)
tree38177020e6c666b90d9a434a53cbbac6759d3ed1
parentd3a34a72126fcb22c8474986d196edff94646f4c (diff)
parentdccb00201f9840ca43fecbf863d6c65e23fbe607 (diff)
Merge pull request #2162 from yahoo/geirst/use-empty-summarymap-config-during-replay
Create empty summarymap config for replay config.
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp23
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.h4
3 files changed, 23 insertions, 6 deletions
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
index 7c49956ea69..90532670e74 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
@@ -1,12 +1,13 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/config-attributes.h>
+#include <vespa/config-imported-fields.h>
+#include <vespa/config-rank-profiles.h>
+#include <vespa/searchcore/proton/attribute/attribute_specs.h>
#include <vespa/searchcore/proton/server/documentdbconfig.h>
#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/config-rank-profiles.h>
-#include <vespa/config-imported-fields.h>
-#include <vespa/config-attributes.h>
-#include <vespa/searchcore/proton/attribute/attribute_specs.h>
+#include <vespa/config-summarymap.h>
using namespace document;
using namespace proton;
@@ -61,6 +62,13 @@ public:
_builder.attributes(make_shared<AttributesConfig>(builder));
return *this;
}
+ MyConfigBuilder &addSummarymap() {
+ SummarymapConfigBuilder builder;
+ builder.override.resize(1);
+ builder.override.back().field = "my_summary_field";
+ _builder.summarymap(make_shared<SummarymapConfig>(builder));
+ return *this;
+ }
ConfigSP build() {
return _builder.build();
}
@@ -82,7 +90,12 @@ struct Fixture {
nullCfg()
{
basicCfg = MyConfigBuilder(4, schema, repo).addAttribute().build();
- fullCfg = MyConfigBuilder(4, schema, repo).addAttribute().addRankProfile().addRankingConstant().addImportedField().build();
+ fullCfg = MyConfigBuilder(4, schema, repo).addAttribute().
+ addRankProfile().
+ addRankingConstant().
+ addImportedField().
+ addSummarymap().
+ build();
replayCfg = DocumentDBConfig::makeReplayConfig(fullCfg);
}
};
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
index 2633931f223..200402b5d82 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
@@ -226,7 +226,7 @@ DocumentDBConfig::makeReplayConfig(const SP & orig)
o._attributes,
o._attributeSpecs,
o._summary,
- o._summarymap,
+ std::make_shared<SummarymapConfig>(),
o._juniperrc,
o._documenttypes,
o._repo,
diff --git a/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.h b/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.h
index f1f56c4a98a..c0ae34f1d66 100644
--- a/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.h
+++ b/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.h
@@ -58,6 +58,10 @@ public:
_importedFields = importedFields_in;
return *this;
}
+ DocumentDBConfigBuilder &summarymap(const DocumentDBConfig::SummarymapConfigSP &summarymap_in) {
+ _summarymap = summarymap_in;
+ return *this;
+ }
DocumentDBConfig::SP build();
};