aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchcommon/attribute/attribute_utils.cpp
blob: cd5cc58c75ce0f7461374aebacf1e1ad62a96d41 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "attribute_utils.h"
#include <vespa/searchcommon/attribute/config.h>

namespace search::attribute {

bool
isUpdateableInMemoryOnly(const vespalib::string &attrName, const Config &cfg)
{
    auto basicType = cfg.basicType().type();
    return ((basicType != BasicType::Type::PREDICATE) &&
            (basicType != BasicType::Type::REFERENCE)) &&
            !isStructFieldAttribute(attrName);
}

bool
isStructFieldAttribute(const vespalib::string &attrName)
{
    return attrName.find('.') != vespalib::string::npos;
}

}