From d5add2f4c82db7088212e550f7c768317f009d53 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Wed, 21 Apr 2021 21:56:55 +0000 Subject: Support both case sensitive, and case-insensitive search in non-fast-search attributes. --- searchcommon/src/vespa/searchcommon/attribute/config.cpp | 3 +++ searchcommon/src/vespa/searchcommon/attribute/config.h | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'searchcommon/src') diff --git a/searchcommon/src/vespa/searchcommon/attribute/config.cpp b/searchcommon/src/vespa/searchcommon/attribute/config.cpp index 065e9c14de9..c62d7ef0ea1 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/config.cpp +++ b/searchcommon/src/vespa/searchcommon/attribute/config.cpp @@ -14,6 +14,7 @@ Config::Config() noexcept : _isFilter(false), _fastAccess(false), _mutable(false), + _match(Match::UNCASED), _dictionary(), _growStrategy(), _compactionStrategy(), @@ -34,6 +35,7 @@ Config::Config(BasicType bt, CollectionType ct, bool fastSearch_, bool huge_) no _isFilter(false), _fastAccess(false), _mutable(false), + _match(Match::UNCASED), _dictionary(), _growStrategy(), _compactionStrategy(), @@ -62,6 +64,7 @@ Config::operator==(const Config &b) const _isFilter == b._isFilter && _fastAccess == b._fastAccess && _mutable == b._mutable && + _match == b._match && _dictionary == b._dictionary && _growStrategy == b._growStrategy && _compactionStrategy == b._compactionStrategy && diff --git a/searchcommon/src/vespa/searchcommon/attribute/config.h b/searchcommon/src/vespa/searchcommon/attribute/config.h index c1b30303606..fdf3a00ac99 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/config.h +++ b/searchcommon/src/vespa/searchcommon/attribute/config.h @@ -22,6 +22,7 @@ namespace search::attribute { */ class Config { public: + enum class Match { CASED, UNCASED }; Config() noexcept; Config(BasicType bt) noexcept : Config(bt, CollectionType::SINGLE) { } Config(BasicType bt, CollectionType ct) noexcept : Config(bt, ct, false) { } @@ -68,6 +69,7 @@ public: const GrowStrategy & getGrowStrategy() const { return _growStrategy; } const CompactionStrategy &getCompactionStrategy() const { return _compactionStrategy; } const DictionaryConfig & get_dictionary_config() const { return _dictionary; } + Match get_match() const { return _match; } Config & setHuge(bool v) { _huge = v; return *this;} Config & setFastSearch(bool v) { _fastSearch = v; return *this; } Config & setPredicateParams(const PredicateParams &v) { _predicateParams = v; return *this; } @@ -121,6 +123,7 @@ public: return *this; } Config & set_dictionary_config(const DictionaryConfig & cfg) { _dictionary = cfg; return *this; } + Config & set_match(Match match) { _match = match; return *this; } bool operator!=(const Config &b) const { return !(operator==(b)); } bool operator==(const Config &b) const; @@ -134,6 +137,7 @@ private: bool _isFilter; bool _fastAccess; bool _mutable; + Match _match; DictionaryConfig _dictionary; GrowStrategy _growStrategy; CompactionStrategy _compactionStrategy; -- cgit v1.2.3