diff options
author | Geir Storli <geirst@vespa.ai> | 2024-03-27 16:16:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-27 16:16:56 +0100 |
commit | 45e8c0c2b2ab7b3ac9d8e6a8f174b08ac15b342e (patch) | |
tree | b886a2b83b89265239fc22f7a78fda01082832d6 /streamingvisitors/src/vespa/vsm/vsm/tokens_dfw.cpp | |
parent | aa19da6beecdf82393af0f99a12940fb9db92bd9 (diff) | |
parent | 086944ee64cb439c336d8d94d6af1c253a22697b (diff) |
Merge pull request #30747 from vespa-engine/toregge/add-streaming-mode-version-of-tokens-dfw
Add streaming mode version of tokens document field writer.
Diffstat (limited to 'streamingvisitors/src/vespa/vsm/vsm/tokens_dfw.cpp')
-rw-r--r-- | streamingvisitors/src/vespa/vsm/vsm/tokens_dfw.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/streamingvisitors/src/vespa/vsm/vsm/tokens_dfw.cpp b/streamingvisitors/src/vespa/vsm/vsm/tokens_dfw.cpp new file mode 100644 index 00000000000..7861c13a179 --- /dev/null +++ b/streamingvisitors/src/vespa/vsm/vsm/tokens_dfw.cpp @@ -0,0 +1,37 @@ +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "tokens_dfw.h" +#include <vespa/searchsummary/docsummary/i_docsum_store_document.h> +#include "tokens_converter.h" + +using search::docsummary::IDocsumStoreDocument; +using search::docsummary::GetDocsumsState; + +namespace vsm { + +TokensDFW::TokensDFW(const vespalib::string& input_field_name, bool exact_match, search::Normalizing normalize_mode) + : DocsumFieldWriter(), + _input_field_name(input_field_name), + _exact_match(exact_match), + _normalize_mode(normalize_mode) +{ +} + +TokensDFW::~TokensDFW() = default; + +bool +TokensDFW::isGenerated() const +{ + return false; +} + +void +TokensDFW::insertField(uint32_t, const IDocsumStoreDocument* doc, GetDocsumsState&, vespalib::slime::Inserter& target) const +{ + if (doc != nullptr) { + TokensConverter converter(_exact_match, _normalize_mode); + doc->insert_summary_field(_input_field_name, target, &converter); + } +} + +} |