// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "singlestringattribute.h" #include "singleenumattribute.hpp" #include "attributevector.hpp" #include "single_string_enum_hint_search_context.h" #include #include #include #include #include #include namespace search { //----------------------------------------------------------------------------- // SingleValueStringAttributeT public //----------------------------------------------------------------------------- template SingleValueStringAttributeT:: SingleValueStringAttributeT(const vespalib::string &name, const AttributeVector::Config & c) : SingleValueEnumAttribute(name, c) { } template SingleValueStringAttributeT::SingleValueStringAttributeT(const vespalib::string &name) : SingleValueStringAttributeT(name, AttributeVector::Config(AttributeVector::BasicType::STRING)) { } template SingleValueStringAttributeT::~SingleValueStringAttributeT() = default; template void SingleValueStringAttributeT::freezeEnumDictionary() { this->getEnumStore().freeze_dictionary(); } template std::unique_ptr SingleValueStringAttributeT::getSearch(QueryTermSimpleUP qTerm, const attribute::SearchContextParams& params) const { bool cased = this->get_match_is_cased(); auto docid_limit = this->getCommittedDocIdLimit(); return std::make_unique(std::move(qTerm), cased, params.fuzzy_matching_algorithm(), *this, this->_enumIndices.make_read_view(docid_limit), this->_enumStore, this->getStatus().getNumValues()); } }