aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/common/indexschema_inspector.cpp
blob: a59b386f26914156170650dcaf80e0b2ba29bfbe (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "indexschema_inspector.h"
#include <vespa/config-indexschema.h>
#include "config_hash.hpp"

namespace proton {

IndexschemaInspector::IndexschemaInspector(const IndexschemaConfig &config)
    : IIndexschemaInspector(),
      _hash(config.indexfield)
{
}

IndexschemaInspector::~IndexschemaInspector()
{
}

bool
IndexschemaInspector::isStringIndex(const vespalib::string &name) const
{
    auto index = _hash.lookup(name);
    if (index != nullptr) {
        if (index->datatype == IndexschemaConfig::Indexfield::Datatype::STRING) {
            return true;
        }
    }
    return false;
}

} // namespace proton