aboutsummaryrefslogtreecommitdiffstats
path: root/streamingvisitors/src/vespa/vsm/vsm/tokens_converter.h
blob: 689b0b95b02feee7d6b79405f513ec92aa00e41b (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 <vespa/searchsummary/docsummary/i_string_field_converter.h>
#include <vespa/searchlib/query/query_normalization.h>

namespace vsm {

/*
 * Class converting a string field value into an array
 * containing the tokens.
 */
class TokensConverter : public search::docsummary::IStringFieldConverter
{
    vespalib::stringref _text;
    bool                _exact_match;
    search::Normalizing _normalize_mode;

public:
    TokensConverter(bool exact_match, search::Normalizing normalize_mode);
    ~TokensConverter() override;
    void convert(const document::StringFieldValue &input, vespalib::slime::Inserter& inserter) override;
    bool render_weighted_set_as_array() const override;
};

}