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

#include "attribute_utils.h"
#include "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;
}

}