aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary/src/vespa/searchsummary/docsummary/docsum_field_writer_factory.cpp
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-01-05 15:54:29 +0100
committerTor Egge <Tor.Egge@online.no>2023-01-05 15:54:29 +0100
commite529812763b6c4efe2b8dbd9b4b87f581d7bec7a (patch)
tree61322da69619c961200770437c6f39cec9afdf32 /searchsummary/src/vespa/searchsummary/docsummary/docsum_field_writer_factory.cpp
parent6cbf34743397d5039dcff4c19893401cfd471cd1 (diff)
Add interface class IKeywordExtractorFactory.
Move ownership of IKeywordExtractor to JuniperDFW.
Diffstat (limited to 'searchsummary/src/vespa/searchsummary/docsummary/docsum_field_writer_factory.cpp')
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsum_field_writer_factory.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsum_field_writer_factory.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsum_field_writer_factory.cpp
index dc215d9c2ba..ee94b0d452d 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsum_field_writer_factory.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsum_field_writer_factory.cpp
@@ -20,9 +20,10 @@ using vespalib::IllegalArgumentException;
namespace search::docsummary {
-DocsumFieldWriterFactory::DocsumFieldWriterFactory(bool use_v8_geo_positions, const IDocsumEnvironment& env)
+DocsumFieldWriterFactory::DocsumFieldWriterFactory(bool use_v8_geo_positions, const IDocsumEnvironment& env, const IKeywordExtractorFactory& keyword_extractor_factory)
: _use_v8_geo_positions(use_v8_geo_positions),
_env(env),
+ _keyword_extractor_factory(keyword_extractor_factory),
_matching_elems_fields(std::make_shared<MatchingElementsFields>())
{
}
@@ -65,7 +66,7 @@ DocsumFieldWriterFactory::create_docsum_field_writer(const vespalib::string& fie
auto fw = std::make_unique<DynamicTeaserDFW>(getEnvironment().getJuniper());
auto fw_ptr = fw.get();
fieldWriter = std::move(fw);
- if (!fw_ptr->Init(field_name.c_str(), source)) {
+ if (!fw_ptr->Init(field_name.c_str(), source, _keyword_extractor_factory)) {
throw IllegalArgumentException("Failed to initialize DynamicTeaserDFW.");
}
} else {