aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary/src/vespa/searchsummary/docsummary/attribute_tokens_dfw.h
blob: 53bb3d73290026e09ae065873e6faf84f6d7e6b2 (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
29
30
// 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 for writing values from a string attribute vector as arrays
 * containing the tokens. The string values are not split but they are
 * lowercased if the string attribute vector uses uncased matching.
 */
class AttributeTokensDFW : public DocsumFieldWriter
{
private:
    vespalib::string            _input_field_name;
    uint32_t _state_index; // index into _fieldWriterStates in GetDocsumsState

protected:
    const vespalib::string & getAttributeName() const override;
public:
    AttributeTokensDFW(const vespalib::string& input_field_name);
    ~AttributeTokensDFW() override;
    bool isGenerated() const override;
    bool setFieldWriterStateIndex(uint32_t fieldWriterStateIndex) override;
    void insertField(uint32_t docid, const IDocsumStoreDocument* doc, GetDocsumsState& state, vespalib::slime::Inserter& target) const override;
};

}