aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary/src/vespa/searchsummary/docsummary/copy_dfw.h
blob: abcddc5a309694527d73ea04a301027e3c739547 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "docsum_field_writer.h"

namespace search::docsummary {

class ResultConfig;

/*
 * Class for writing document summaries with content from another field.
 */
class CopyDFW : public DocsumFieldWriter
{
private:
    vespalib::string _input_field_name;

public:
    explicit CopyDFW(const vespalib::string& inputField);
    ~CopyDFW() override;

    bool isGenerated() const override { return false; }
    void insertField(uint32_t docid, const IDocsumStoreDocument* doc, GetDocsumsState& state, vespalib::slime::Inserter &target) const override;
};

}