aboutsummaryrefslogtreecommitdiffstats
path: root/streamingvisitors/src/vespa/vsm/searcher/utf8flexiblestringfieldsearcher.h
blob: 63931af003693b88119ba37f0a50e94b84ebff5f (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
31
32
33
34
35
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/vsm/searcher/utf8stringfieldsearcherbase.h>

namespace vsm
{

/**
 * This class does utf8 searches based on the query term type.
 * It will choose between regular search strategy (including prefix) and substring search strategy.
 **/
class UTF8FlexibleStringFieldSearcher : public UTF8StringFieldSearcherBase
{
private:
    /**
     * Tries to match the given query term against the content of the given field reference.
     * Search strategy is choosen based on the query term type.
     **/
    virtual size_t matchTerm(const FieldRef & f, search::streaming::QueryTerm & qt) override;

    /**
     * Tries to match each query term in the underlying query against the content of the given field reference.
     * Search strategy is choosen based on the query term type.
     **/
    virtual size_t matchTerms(const FieldRef & f, const size_t shortestTerm) override;

public:
    std::unique_ptr<FieldSearcher> duplicate() const override;
    UTF8FlexibleStringFieldSearcher();
    UTF8FlexibleStringFieldSearcher(FieldIdT fId);
};

}