summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-10-30 15:26:12 +0100
committerTor Egge <Tor.Egge@online.no>2023-10-30 15:26:12 +0100
commit1b2aa2aa93b600cfd26e3f1920c9c63ab7ddf609 (patch)
tree8ab9450c4881624e0519a31708023c07562b135d /searchlib
parent621520610face5ad70122a4ddecb61e2222798d8 (diff)
Add attribute tokens dfw.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchcommon/attribute/iattributevector.h7
-rw-r--r--searchlib/src/vespa/searchlib/attribute/stringbase.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/stringbase.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchcommon/attribute/iattributevector.h b/searchlib/src/vespa/searchcommon/attribute/iattributevector.h
index d613bf61a16..b44b6a4baf2 100644
--- a/searchlib/src/vespa/searchcommon/attribute/iattributevector.h
+++ b/searchlib/src/vespa/searchcommon/attribute/iattributevector.h
@@ -419,6 +419,13 @@ public:
*/
virtual bool isImported() const = 0;
+ /*
+ * Returns whether the match setting for the attribute is uncased.
+ * This is only relevant for string attributes (i.e. when isStringType()
+ * returns true). The default for string attributes is uncased matching.
+ */
+ virtual bool has_uncased_matching() const noexcept { return true; }
+
/**
* Will serialize the values for the documentid in ascending order. The serialized form can be used by memcmp and
* sortorder will be preserved.
diff --git a/searchlib/src/vespa/searchlib/attribute/stringbase.cpp b/searchlib/src/vespa/searchlib/attribute/stringbase.cpp
index ac8178f8afa..0e261059777 100644
--- a/searchlib/src/vespa/searchlib/attribute/stringbase.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/stringbase.cpp
@@ -283,6 +283,12 @@ StringAttribute::get_match_is_cased() const noexcept {
return getConfig().get_match() == attribute::Config::Match::CASED;
}
+bool
+StringAttribute::has_uncased_matching() const noexcept
+{
+ return !get_match_is_cased();
+}
+
template bool AttributeVector::clearDoc(StringAttribute::ChangeVector& changes, DocId doc);
template bool AttributeVector::update(StringAttribute::ChangeVector& changes, DocId doc, const StringChangeData& v);
template bool AttributeVector::append(StringAttribute::ChangeVector& changes, DocId doc, const StringChangeData& v, int32_t w, bool doCount);
diff --git a/searchlib/src/vespa/searchlib/attribute/stringbase.h b/searchlib/src/vespa/searchlib/attribute/stringbase.h
index 1440b945428..e65b181f37d 100644
--- a/searchlib/src/vespa/searchlib/attribute/stringbase.h
+++ b/searchlib/src/vespa/searchlib/attribute/stringbase.h
@@ -72,6 +72,7 @@ protected:
vespalib::MemoryUsage getChangeVectorMemoryUsage() const override;
bool get_match_is_cased() const noexcept;
+ bool has_uncased_matching() const noexcept override;
long onSerializeForAscendingSort(DocId doc, void * serTo, long available, const common::BlobConverter * bc) const override;
long onSerializeForDescendingSort(DocId doc, void * serTo, long available, const common::BlobConverter * bc) const override;
private: