Skip to content

Commit

Permalink
Merge pull request #33029 from vespa-engine/toregge/prefer-enum-value…
Browse files Browse the repository at this point in the history
…-over-string

Prefer enum value over string, to get compile time checking.
  • Loading branch information
geirst authored Dec 12, 2024
2 parents 4bf1aff + f65a3e6 commit 3b8c00e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ struct RangeLimitFixture {
a1FieldSpec("a1", 1, 1),
f1FieldSpec("f1", 2, 2)
{
attrManager.addAttribute(search::AttributeFactory::createAttribute(a1FieldSpec.getName(), Config(BasicType("int64"))));
attrManager.addAttribute(search::AttributeFactory::createAttribute(f1FieldSpec.getName(), Config(BasicType("double"))));
attrManager.addAttribute(search::AttributeFactory::createAttribute(a1FieldSpec.getName(), Config(BasicType::INT64)));
attrManager.addAttribute(search::AttributeFactory::createAttribute(f1FieldSpec.getName(), Config(BasicType::DOUBLE)));
}
search::AttributeBlueprintFactory attrSearchable;
search::attribute::test::MockAttributeManager attrManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ setupAttributeManager(MockAttributeManager &manager, bool isFilter)
{
AttributeVector::DocId docId;
{
AttributeVector::SP attr_sp = AttributeFactory::createAttribute("integer", Config(BasicType("int64")).setIsFilter(isFilter));
AttributeVector::SP attr_sp = AttributeFactory::createAttribute("integer", Config(BasicType::INT64).setIsFilter(isFilter));
manager.addAttribute(attr_sp);

auto *attr = (IntegerAttribute*)(attr_sp.get());
Expand All @@ -49,7 +49,7 @@ setupAttributeManager(MockAttributeManager &manager, bool isFilter)
}
}
{
AttributeVector::SP attr_sp = AttributeFactory::createAttribute("string", Config(BasicType("string")).setIsFilter(isFilter));
AttributeVector::SP attr_sp = AttributeFactory::createAttribute("string", Config(BasicType::STRING).setIsFilter(isFilter));
manager.addAttribute(attr_sp);

auto *attr = (StringAttribute*)(attr_sp.get());
Expand All @@ -62,7 +62,7 @@ setupAttributeManager(MockAttributeManager &manager, bool isFilter)
}
{
AttributeVector::SP attr_sp = AttributeFactory::createAttribute(
"multi", Config(BasicType("int64"), search::attribute::CollectionType("array")).setIsFilter(isFilter));
"multi", Config(BasicType::INT64, search::attribute::CollectionType::ARRAY).setIsFilter(isFilter));
manager.addAttribute(attr_sp);
auto *attr = (IntegerAttribute*)(attr_sp.get());
for (size_t i = 1; i < 10; ++i) {
Expand Down

0 comments on commit 3b8c00e

Please sign in to comment.