aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary/src/vespa/searchsummary/docsummary/copy_dfw.cpp
blob: 94e5420881b0619b106e4f73353ea63166ee7ddb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "copy_dfw.h"
#include "i_docsum_store_document.h"
#include <vespa/vespalib/data/slime/slime.h>

#include <vespa/log/log.h>
LOG_SETUP(".searchlib.docsummary.copy_dfw");

namespace search::docsummary {

CopyDFW::CopyDFW(const vespalib::string& inputField)
    : _input_field_name(inputField)
{
}

CopyDFW::~CopyDFW() = default;

void
CopyDFW::insertField(uint32_t, const IDocsumStoreDocument* doc, GetDocsumsState&,
                     vespalib::slime::Inserter &target) const
{
    if (doc != nullptr) {
        doc->insert_summary_field(_input_field_name, target);
    }
}

}