aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-04-08 15:47:21 +0200
committerGitHub <noreply@github.com>2021-04-08 15:47:21 +0200
commit248b9d5278345c4932b6cc9f598e3943be44b850 (patch)
tree04a99770eeea491091e35798a6935b4c128f9de0
parent449f608d2770977732fd3de4a24d52354a84c747 (diff)
parent3cee885280e5a51f98580c3f484c7c54d3cbe9ef (diff)
Merge pull request #17312 from vespa-engine/toregge/no-folding-without-btree
If unique values can be unsorted then any enum value change is
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enum_store_loaders.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enum_store_loaders.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/enum_store_loaders.cpp b/searchlib/src/vespa/searchlib/attribute/enum_store_loaders.cpp
index 56cca654b96..0e8aa6ee5a8 100644
--- a/searchlib/src/vespa/searchlib/attribute/enum_store_loaders.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/enum_store_loaders.cpp
@@ -96,7 +96,8 @@ EnumeratedLoader::build_dictionary()
EnumeratedPostingsLoader::EnumeratedPostingsLoader(IEnumStore& store)
: EnumeratedLoaderBase(store),
_loaded_enums(),
- _posting_indexes()
+ _posting_indexes(),
+ _has_btree_dictionary(_store.get_dictionary().get_has_btree_dictionary())
{
}
@@ -105,7 +106,7 @@ EnumeratedPostingsLoader::~EnumeratedPostingsLoader() = default;
bool
EnumeratedPostingsLoader::is_folded_change(Index lhs, Index rhs) const
{
- return _store.is_folded_change(lhs, rhs);
+ return !_has_btree_dictionary || _store.is_folded_change(lhs, rhs);
}
void
diff --git a/searchlib/src/vespa/searchlib/attribute/enum_store_loaders.h b/searchlib/src/vespa/searchlib/attribute/enum_store_loaders.h
index 4fa63646ed3..e9e6810cb91 100644
--- a/searchlib/src/vespa/searchlib/attribute/enum_store_loaders.h
+++ b/searchlib/src/vespa/searchlib/attribute/enum_store_loaders.h
@@ -54,6 +54,7 @@ class EnumeratedPostingsLoader : public EnumeratedLoaderBase {
private:
attribute::LoadedEnumAttributeVector _loaded_enums;
vespalib::Array<uint32_t> _posting_indexes;
+ bool _has_btree_dictionary;
public:
EnumeratedPostingsLoader(IEnumStore& store);