summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-08-26 13:09:52 +0200
committerTor Egge <Tor.Egge@online.no>2022-08-26 13:09:52 +0200
commitaa87d472c6b4f1e661c09378b5f86d947b8c7fb0 (patch)
treee9aabdedfc511aefec755b54a49f7d34eb7a277b /searchcore
parent3604078ee2f7ea417d9da734b5427beea03e5d90 (diff)
Remove IDocsumStore::getSummaryClassId() member function.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp64
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/CMakeLists.txt2
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp16
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.h19
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/fieldcache.cpp37
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/fieldcache.h38
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/fieldcacherepo.cpp47
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/fieldcacherepo.h36
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/isummarymanager.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp34
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h6
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchview.cpp2
14 files changed, 25 insertions, 284 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index f4ee877da0d..d93fa33e2ec 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -4,6 +4,7 @@
#include <vespa/config-bucketspaces.h>
#include <vespa/config/helper/configgetter.hpp>
#include <vespa/document/config/documenttypes_config_fwd.h>
+#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/test/make_bucket_space.h>
#include <vespa/eval/eval/simple_value.h>
@@ -134,10 +135,6 @@ public:
Document::UP doc = _bld.endDocument();
_str.write(_serialNum++, docId, *doc);
}
-
- FieldCacheRepo::UP createFieldCacheRepo(const ResultConfig &resConfig) const {
- return std::make_unique<FieldCacheRepo>(resConfig, _bld.getDocumentType());
- }
};
namespace {
@@ -293,7 +290,6 @@ class Fixture
private:
std::unique_ptr<vespa::config::search::SummaryConfig> _summaryCfg;
ResultConfig _resultCfg;
- std::set<vespalib::string> _markupFields;
public:
Fixture();
@@ -302,10 +298,6 @@ public:
const ResultConfig &getResultConfig() const{
return _resultCfg;
}
-
- const std::set<vespalib::string> &getMarkupFields() const{
- return _markupFields;
- }
};
bool
@@ -385,10 +377,7 @@ TEST_F("requireThatAdapterHandlesAllFieldTypes", Fixture)
bc.endDocument(0);
DocumentStoreAdapter dsa(bc._str,
- *bc._repo,
- f.getResultConfig(), "class0",
- bc.createFieldCacheRepo(f.getResultConfig())->getFieldCache("class0"),
- f.getMarkupFields());
+ *bc._repo);
auto res = dsa.getMappedDocsum(0);
EXPECT_EQUAL(-1, res->get_field_value("a")->getAsInt());
EXPECT_EQUAL(32767, res->get_field_value("b")->getAsInt());
@@ -420,9 +409,7 @@ TEST_F("requireThatAdapterHandlesMultipleDocuments", Fixture)
addInt(2000).endField();
bc.endDocument(1);
- DocumentStoreAdapter dsa(bc._str, *bc._repo, f.getResultConfig(), "class1",
- bc.createFieldCacheRepo(f.getResultConfig())->getFieldCache("class1"),
- f.getMarkupFields());
+ DocumentStoreAdapter dsa(bc._str, *bc._repo);
{ // doc 0
auto res = dsa.getMappedDocsum(0);
EXPECT_EQUAL(1000, res->get_field_value("a")->getAsInt());
@@ -454,9 +441,7 @@ TEST_F("requireThatAdapterHandlesDocumentIdField", Fixture)
addStr("foo").
endField();
bc.endDocument(0);
- DocumentStoreAdapter dsa(bc._str, *bc._repo, f.getResultConfig(), "class4",
- bc.createFieldCacheRepo(f.getResultConfig())->getFieldCache("class4"),
- f.getMarkupFields());
+ DocumentStoreAdapter dsa(bc._str, *bc._repo);
auto res = dsa.getMappedDocsum(0);
vespalib::Slime slime;
vespalib::slime::SlimeInserter inserter(slime);
@@ -795,9 +780,7 @@ TEST_F("requireThatAnnotationsAreUsed", Fixture)
EXPECT_EQUAL("foo bar", act->getValue("g")->getAsString());
EXPECT_EQUAL("foo bar", act->getValue("dynamicstring")->getAsString());
- DocumentStoreAdapter dsa(store, *bc._repo, f.getResultConfig(), "class0",
- bc.createFieldCacheRepo(f.getResultConfig())->getFieldCache("class0"),
- f.getMarkupFields());
+ DocumentStoreAdapter dsa(store, *bc._repo);
EXPECT_TRUE(assertString("foo bar", "g", dsa, 1));
EXPECT_TRUE(assertAnnotatedString(TERM_EMPTY + "foo" + TERM_SEP +
" " + TERM_SEP +
@@ -946,9 +929,7 @@ TEST_F("requireThatUrisAreUsed", Fixture)
EXPECT_TRUE(act.get() != nullptr);
EXPECT_EQUAL(exp->getType(), act->getType());
- DocumentStoreAdapter dsa(store, *bc._repo, f.getResultConfig(), "class0",
- bc.createFieldCacheRepo(f.getResultConfig())->getFieldCache("class0"),
- f.getMarkupFields());
+ DocumentStoreAdapter dsa(store, *bc._repo);
auto res = dsa.getMappedDocsum(1);
EXPECT_EQUAL("http://www.example.com:81/fluke?ab=2#4", SummaryFieldConverter::convertSummaryField(false, *res->get_field_value("urisingle"))->getAsString());
{
@@ -1073,9 +1054,7 @@ TEST_F("requireThatRawFieldsWorks", Fixture)
EXPECT_TRUE(act.get() != nullptr);
EXPECT_EQUAL(exp->getType(), act->getType());
- DocumentStoreAdapter dsa(store, *bc._repo, f.getResultConfig(), "class0",
- bc.createFieldCacheRepo(f.getResultConfig())->getFieldCache("class0"),
- f.getMarkupFields());
+ DocumentStoreAdapter dsa(store, *bc._repo);
ASSERT_TRUE(assertString(raw1s, "i", dsa, 1));
@@ -1100,41 +1079,14 @@ TEST_F("requireThatRawFieldsWorks", Fixture)
}
}
-TEST_F("requireThatFieldCacheRepoCanReturnDefaultFieldCache", Fixture)
-{
- Schema s;
- s.addSummaryField(Schema::SummaryField("a", schema::DataType::INT32));
- BuildContext bc(s);
- FieldCacheRepo::UP repo = bc.createFieldCacheRepo(f.getResultConfig());
- FieldCache::CSP cache = repo->getFieldCache("");
- EXPECT_TRUE(cache.get() == repo->getFieldCache("class1").get());
- EXPECT_EQUAL(1u, cache->size());
- EXPECT_EQUAL("a", cache->getField(0)->getName());
-}
-
Fixture::Fixture()
: _summaryCfg(),
- _resultCfg(),
- _markupFields()
+ _resultCfg()
{
std::string cfgId("summary");
_summaryCfg = ConfigGetter<vespa::config::search::SummaryConfig>::getConfig(
cfgId, ::config::FileSpec(TEST_PATH("summary.cfg")));
_resultCfg.ReadConfig(*_summaryCfg, cfgId.c_str());
- std::string mapCfgId("summarymap");
- std::unique_ptr<vespa::config::search::SummarymapConfig> mapCfg = ::config::ConfigGetter<vespa::config::search::SummarymapConfig>::getConfig(
- mapCfgId, ::config::FileSpec(TEST_PATH("summarymap.cfg")));
- for (size_t i = 0; i < mapCfg->override.size(); ++i) {
- const vespa::config::search::SummarymapConfig::Override & o = mapCfg->override[i];
- if (o.command == "dynamicteaser") {
- vespalib::string markupField = o.arguments;
- if (markupField.empty())
- continue;
- // Assume just one argument: source field that must contain markup
- _markupFields.insert(markupField);
- LOG(info, "Field %s has markup", markupField.c_str());
- }
- }
}
Fixture::~Fixture() = default;
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index b57ff052e82..21d50b0a9a1 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -2,6 +2,7 @@
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/searchcore/proton/attribute/attribute_writer.h>
#include <vespa/searchcore/proton/attribute/attributemanager.h>
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/docsummary/CMakeLists.txt
index f17eae06d6e..9861812df6b 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/CMakeLists.txt
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/CMakeLists.txt
@@ -4,8 +4,6 @@ vespa_add_library(searchcore_docsummary STATIC
docsumcontext.cpp
document_store_explorer.cpp
documentstoreadapter.cpp
- fieldcache.cpp
- fieldcacherepo.cpp
summarycompacttarget.cpp
summaryflushtarget.cpp
summarymanager.cpp
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
index 353ee8d73fb..7b4db47f585 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
@@ -77,9 +77,8 @@ DocsumContext::createSlimeReply()
Cursor & root = response->setObject();
Cursor & array = root.setArray(DOCSUMS);
const Symbol docsumSym = response->insert(DOCSUM);
- IDocsumWriter::ResolveClassInfo rci = _docsumWriter.resolveClassInfo(_docsumState._args.getResultClassName(),
- _docsumStore.getSummaryClassId());
- _docsumState._omit_summary_features = rci.outputClass->omit_summary_features();
+ IDocsumWriter::ResolveClassInfo rci = _docsumWriter.resolveClassInfo(_docsumState._args.getResultClassName());
+ _docsumState._omit_summary_features = (rci.outputClass != nullptr) ? rci.outputClass->omit_summary_features() : true;
uint32_t num_ok(0);
for (uint32_t docId : _docsumState._docsumbuf) {
if (_request.expired() ) { break; }
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp
index 90850007467..a62bd155b87 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp
@@ -3,6 +3,7 @@
#include "documentstoreadapter.h"
#include <vespa/searchsummary/docsummary/docsum_store_document.h>
#include <vespa/searchsummary/docsummary/summaryfieldconverter.h>
+#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/fieldvalue/stringfieldvalue.h>
#include <vespa/eval/eval/value_codec.h>
#include <vespa/vespalib/objects/nbostream.h>
@@ -24,18 +25,9 @@ const vespalib::string DOCUMENT_ID_FIELD("documentid");
DocumentStoreAdapter::
DocumentStoreAdapter(const search::IDocumentStore & docStore,
- const DocumentTypeRepo &repo,
- const ResultConfig & resultConfig,
- const vespalib::string & resultClassName,
- const FieldCache::CSP & fieldCache,
- const std::set<vespalib::string> &markupFields)
+ const DocumentTypeRepo &repo)
: _docStore(docStore),
- _repo(repo),
- _resultConfig(resultConfig),
- _resultClass(resultConfig.
- LookupResultClass(resultConfig.LookupResultClassId(resultClassName.c_str()))),
- _fieldCache(fieldCache),
- _markupFields(markupFields)
+ _repo(repo)
{
}
@@ -44,7 +36,7 @@ DocumentStoreAdapter::~DocumentStoreAdapter() = default;
std::unique_ptr<const IDocsumStoreDocument>
DocumentStoreAdapter::getMappedDocsum(uint32_t docId)
{
- Document::UP document = _docStore.read(docId, _repo);
+ auto document = _docStore.read(docId, _repo);
if ( ! document) {
LOG(debug, "Did not find summary document for docId %u. Returning empty docsum", docId);
return {};
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.h b/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.h
index 7a3a810bb55..4d77e8c8705 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.h
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.h
@@ -2,10 +2,7 @@
#pragma once
-#include "fieldcache.h"
#include <vespa/searchsummary/docsummary/docsumstore.h>
-#include <vespa/searchsummary/docsummary/resultconfig.h>
-#include <vespa/document/fieldvalue/document.h>
#include <vespa/searchlib/docstore/idocumentstore.h>
namespace proton {
@@ -15,28 +12,14 @@ class DocumentStoreAdapter : public search::docsummary::IDocsumStore
private:
const search::IDocumentStore & _docStore;
const document::DocumentTypeRepo & _repo;
- const search::docsummary::ResultConfig & _resultConfig;
- const search::docsummary::ResultClass * _resultClass;
- FieldCache::CSP _fieldCache;
- const std::set<vespalib::string> & _markupFields;
public:
DocumentStoreAdapter(const search::IDocumentStore &docStore,
- const document::DocumentTypeRepo &repo,
- const search::docsummary::ResultConfig &resultConfig,
- const vespalib::string &resultClassName,
- const FieldCache::CSP &fieldCache,
- const std::set<vespalib::string> &markupFields);
+ const document::DocumentTypeRepo &repo);
~DocumentStoreAdapter();
- const search::docsummary::ResultClass *getResultClass() const {
- return _resultClass;
- }
-
uint32_t getNumDocs() const override { return _docStore.getDocIdLimit(); }
std::unique_ptr<const search::docsummary::IDocsumStoreDocument> getMappedDocsum(uint32_t docId) override;
- uint32_t getSummaryClassId() const override { return _resultClass->GetClassID(); }
-
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/fieldcache.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/fieldcache.cpp
deleted file mode 100644
index cdf71de2346..00000000000
--- a/searchcore/src/vespa/searchcore/proton/docsummary/fieldcache.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "fieldcache.h"
-#include <vespa/document/fieldvalue/document.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".proton.docsummary.fieldcache");
-
-using namespace document;
-using namespace search::docsummary;
-
-namespace proton {
-
-FieldCache::FieldCache() :
- _cache()
-{
-}
-
-FieldCache::FieldCache(const ResultClass &resClass,
- const DocumentType &docType) :
- _cache()
-{
- LOG(debug, "Creating field cache for summary class '%s'", resClass.GetClassName());
- for (uint32_t i = 0; i < resClass.GetNumEntries(); ++i) {
- const ResConfigEntry *entry = resClass.GetEntry(i);
- const vespalib::string fieldName(entry->_bindname);
- if (docType.hasField(fieldName)) {
- const Field &field = docType.getField(fieldName);
- LOG(debug, "Caching Field instance for field '%s': %s.%u",
- fieldName.c_str(), field.getName().data(), field.getId());
- _cache.push_back(std::make_shared<const Field>(field));
- } else {
- _cache.push_back(Field::CSP());
- }
- }
-}
-
-} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/fieldcache.h b/searchcore/src/vespa/searchcore/proton/docsummary/fieldcache.h
deleted file mode 100644
index 4cb6b3f8ce8..00000000000
--- a/searchcore/src/vespa/searchcore/proton/docsummary/fieldcache.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#pragma once
-
-#include <vespa/document/base/field.h>
-#include <vespa/document/datatype/documenttype.h>
-#include <vespa/searchsummary/docsummary/resultclass.h>
-
-namespace proton {
-
-/**
- * A cache of document::Field instances that is associated
- * with a summary result class.
- **/
-class FieldCache
-{
-private:
- typedef std::vector<document::Field::CSP> Cache;
-
- Cache _cache;
-
-public:
- typedef std::shared_ptr<const FieldCache> CSP;
-
- FieldCache();
-
- FieldCache(const search::docsummary::ResultClass &resClass,
- const document::DocumentType &docType);
-
- size_t size() const { return _cache.size(); }
-
- const document::Field *getField(size_t idx) const {
- return _cache[idx].get();
- }
-};
-
-} // namespace proton
-
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/fieldcacherepo.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/fieldcacherepo.cpp
deleted file mode 100644
index 84a2379d031..00000000000
--- a/searchcore/src/vespa/searchcore/proton/docsummary/fieldcacherepo.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "fieldcacherepo.h"
-
-#include <vespa/log/log.h>
-LOG_SETUP(".proton.docsummary.fieldcacherepo");
-
-using namespace document;
-using namespace search::docsummary;
-
-namespace proton {
-
-FieldCacheRepo::FieldCacheRepo() :
- _repo(),
- _defaultCache(std::make_shared<const FieldCache>())
-{
-}
-
-FieldCacheRepo::FieldCacheRepo(const ResultConfig &resConfig,
- const DocumentType &docType) :
- _repo(),
- _defaultCache(std::make_shared<const FieldCache>())
-{
- for (ResultConfig::const_iterator it(resConfig.begin()), mt(resConfig.end()); it != mt; it++) {
- auto cache = std::make_shared<const FieldCache>(*it, docType);
- vespalib::string className(it->GetClassName());
- LOG(debug, "Adding field cache for summary class '%s' to repo",
- className.c_str());
- _repo.insert(std::make_pair(className, cache));
- }
- const ResultClass *defaultClass = resConfig.LookupResultClass(resConfig.LookupResultClassId(""));
- if (defaultClass != NULL) {
- _defaultCache = getFieldCache(defaultClass->GetClassName());
- }
-}
-
-FieldCache::CSP
-FieldCacheRepo::getFieldCache(const vespalib::string &resultClass) const
-{
- Repo::const_iterator itr = _repo.find(resultClass);
- if (itr != _repo.end()) {
- return itr->second;
- }
- return _defaultCache;
-}
-
-} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/fieldcacherepo.h b/searchcore/src/vespa/searchcore/proton/docsummary/fieldcacherepo.h
deleted file mode 100644
index 8844ca0ab46..00000000000
--- a/searchcore/src/vespa/searchcore/proton/docsummary/fieldcacherepo.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#pragma once
-
-#include <vespa/document/datatype/documenttype.h>
-#include <vespa/searchsummary/docsummary/resultconfig.h>
-#include "fieldcache.h"
-
-namespace proton {
-
-/**
- * A repository of FieldCache instances,
- * one for each summary result class that we have in the summary result config.
- **/
-class FieldCacheRepo
-{
-private:
- typedef std::map<vespalib::string, FieldCache::CSP> Repo;
-
- Repo _repo;
- FieldCache::CSP _defaultCache; // corresponds to the default summary class
-
-public:
- typedef std::unique_ptr<FieldCacheRepo> UP;
-
- FieldCacheRepo();
-
- FieldCacheRepo(const search::docsummary::ResultConfig &resConfig,
- const document::DocumentType &docType);
-
- FieldCache::CSP getFieldCache(const vespalib::string &resultClass) const;
-
-};
-
-} // namespace proton
-
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/isummarymanager.h b/searchcore/src/vespa/searchcore/proton/docsummary/isummarymanager.h
index d8df368b13e..bf064a707fe 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/isummarymanager.h
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/isummarymanager.h
@@ -35,7 +35,7 @@ public:
virtual search::docsummary::IDocsumWriter &getDocsumWriter() const = 0;
virtual search::docsummary::ResultConfig &getResultConfig() = 0;
- virtual search::docsummary::IDocsumStore::UP createDocsumStore(const vespalib::string &resultClassName) = 0;
+ virtual search::docsummary::IDocsumStore::UP createDocsumStore() = 0;
// Inherit doc from IDocsumEnvironment
virtual search::IAttributeManager *getAttributeManager() override = 0;
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp
index 28a43325e50..ee6911f5c1e 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp
@@ -79,7 +79,7 @@ ShrinkSummaryLidSpaceFlushTarget::initFlush(SerialNum currentSerial, std::shared
}
SummaryManager::SummarySetup::
-SummarySetup(const vespalib::string & baseDir, const DocTypeName & docTypeName, const SummaryConfig & summaryCfg,
+SummarySetup(const vespalib::string & baseDir, const SummaryConfig & summaryCfg,
const SummarymapConfig & summarymapCfg, const JuniperrcConfig & juniperCfg,
search::IAttributeManager::SP attributeMgr, search::IDocumentStore::SP docStore,
std::shared_ptr<const DocumentTypeRepo> repo)
@@ -89,9 +89,7 @@ SummarySetup(const vespalib::string & baseDir, const DocTypeName & docTypeName,
_juniperConfig(),
_attributeMgr(std::move(attributeMgr)),
_docStore(std::move(docStore)),
- _fieldCacheRepo(),
- _repo(repo),
- _markupFields()
+ _repo(repo)
{
auto resultConfig = std::make_unique<ResultConfig>();
if (!resultConfig->ReadConfig(summaryCfg, make_string("SummaryManager(%s)", baseDir.c_str()).c_str())) {
@@ -107,32 +105,12 @@ SummarySetup(const vespalib::string & baseDir, const DocTypeName & docTypeName,
_docsumWriter = std::make_unique<DynamicDocsumWriter>(resultConfig.release(), nullptr);
DynamicDocsumConfig dynCfg(this, _docsumWriter.get());
dynCfg.configure(summarymapCfg);
- for (const auto & o : summarymapCfg.override) {
- if (o.command == "dynamicteaser") {
- vespalib::string markupField = o.arguments;
- if (markupField.empty())
- continue;
- // Assume just one argument: source field that must contain markup
- _markupFields.insert(markupField);
- }
- }
- const DocumentType *docType = repo->getDocumentType(docTypeName.getName());
- if (docType != nullptr) {
- _fieldCacheRepo = std::make_unique<FieldCacheRepo>(getResultConfig(), *docType);
- } else if (getResultConfig().GetNumResultClasses() == 0) {
- LOG(debug, "Create empty field cache repo for document type '%s'", docTypeName.toString().c_str());
- _fieldCacheRepo = std::make_unique<FieldCacheRepo>();
- } else {
- throw IllegalArgumentException(make_string("Did not find document type '%s' in current document type repo."
- " Cannot setup field cache repo for the summary setup",
- docTypeName.toString().c_str()));
- }
}
IDocsumStore::UP
-SummaryManager::SummarySetup::createDocsumStore(const vespalib::string &resultClassName) {
- return std::make_unique<DocumentStoreAdapter>(*_docStore, *_repo, getResultConfig(), resultClassName,
- _fieldCacheRepo->getFieldCache(resultClassName), _markupFields);
+SummaryManager::SummarySetup::createDocsumStore()
+{
+ return std::make_unique<DocumentStoreAdapter>(*_docStore, *_repo);
}
@@ -141,7 +119,7 @@ SummaryManager::createSummarySetup(const SummaryConfig & summaryCfg, const Summa
const JuniperrcConfig & juniperCfg, const std::shared_ptr<const DocumentTypeRepo> &repo,
const search::IAttributeManager::SP &attributeMgr)
{
- return std::make_shared<SummarySetup>(_baseDir, _docTypeName, summaryCfg, summarymapCfg,
+ return std::make_shared<SummarySetup>(_baseDir, summaryCfg, summarymapCfg,
juniperCfg, attributeMgr, _docStore, repo);
}
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h
index ba55761d091..156b44066c6 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h
@@ -2,7 +2,6 @@
#pragma once
#include "isummarymanager.h"
-#include "fieldcacherepo.h"
#include <vespa/searchcore/proton/attribute/attributemanager.h>
#include <vespa/searchcore/proton/common/doctypename.h>
#include <vespa/searchcorespi/flush/iflushtarget.h>
@@ -29,12 +28,9 @@ public:
std::unique_ptr<juniper::Juniper> _juniperConfig;
search::IAttributeManager::SP _attributeMgr;
search::IDocumentStore::SP _docStore;
- FieldCacheRepo::UP _fieldCacheRepo;
const std::shared_ptr<const document::DocumentTypeRepo> _repo;
- std::set<vespalib::string> _markupFields;
public:
SummarySetup(const vespalib::string & baseDir,
- const DocTypeName & docTypeName,
const vespa::config::search::SummaryConfig & summaryCfg,
const vespa::config::search::SummarymapConfig & summarymapCfg,
const vespa::config::search::summary::JuniperrcConfig & juniperCfg,
@@ -45,7 +41,7 @@ public:
search::docsummary::IDocsumWriter & getDocsumWriter() const override { return *_docsumWriter; }
search::docsummary::ResultConfig & getResultConfig() override { return *_docsumWriter->GetResultConfig(); }
- search::docsummary::IDocsumStore::UP createDocsumStore(const vespalib::string &resultClassName) override;
+ search::docsummary::IDocsumStore::UP createDocsumStore() override;
search::IAttributeManager * getAttributeManager() override { return _attributeMgr.get(); }
vespalib::string lookupIndex(const vespalib::string & s) const override { (void) s; return ""; }
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchview.cpp b/searchcore/src/vespa/searchcore/proton/server/searchview.cpp
index 4e051a18de4..d272a0dedf7 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchview.cpp
@@ -124,7 +124,7 @@ SearchView::getDocsumsInternal(const DocsumRequest & req)
uint64_t startGeneration = readGuard->get().getCurrentGeneration();
convertGidsToLids(req, metaStore, _matchView->getDocIdLimit().get());
- IDocsumStore::UP store(_summarySetup->createDocsumStore(req.resultClassName));
+ IDocsumStore::UP store(_summarySetup->createDocsumStore());
MatchContext::UP mctx = _matchView->createContext();
auto ctx = std::make_unique<DocsumContext>(req, _summarySetup->getDocsumWriter(), *store, _matchView->getMatcher(req.ranking),
mctx->getSearchContext(), mctx->getAttributeContext(),