blob: 62daadbeb2fc96bc27277f8414a6db2ff225be9b (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "attribute_type_matcher.h"
#include <vespa/searchcommon/attribute/config.h>
using search::attribute::BasicType;
namespace proton
{
bool
AttributeTypeMatcher::operator()(const search::attribute::Config &oldConfig, const search::attribute::Config &newConfig) const
{
if ((oldConfig.basicType() != newConfig.basicType()) ||
(oldConfig.collectionType() != newConfig.collectionType())) {
return false;
}
if (newConfig.basicType().type() == BasicType::Type::TENSOR) {
if (oldConfig.tensorType() != newConfig.tensorType()) {
return false;
}
}
if (newConfig.basicType().type() == BasicType::Type::PREDICATE) {
using Params = search::attribute::PersistentPredicateParams;
const Params &oldParams = oldConfig.predicateParams();
const Params &newParams = newConfig.predicateParams();
if (!(oldParams == newParams)) {
return false;
}
}
return true;
}
}
|