diff options
5 files changed, 22 insertions, 10 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp index 932226add9d..acd03a37497 100644 --- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp @@ -28,7 +28,7 @@ MultiValueEnumAttribute<B, M>::extractChangeData(const Change & c, EnumIndex & i if ( ! c.isEnumValid() ) { return this->_enumStore.find_index(c._data.raw(), idx); } - idx = EnumIndex(vespalib::datastore::EntryRef(c._enumScratchPad)); + idx = EnumIndex(vespalib::datastore::EntryRef(c.getEnum())); return true; } @@ -42,9 +42,9 @@ MultiValueEnumAttribute<B, M>::considerAttributeChange(const Change & c, EnumSto { EnumIndex idx; if (!this->_enumStore.find_index(c._data.raw(), idx)) { - c._enumScratchPad = inserter.insert(c._data.raw()).ref(); + c.setEnum(inserter.insert(c._data.raw()).ref()); } else { - c._enumScratchPad = idx.ref(); + c.setEnum(idx.ref()); } } } diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp index 19fa87e35ae..3be159b4847 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp @@ -139,9 +139,9 @@ SingleValueEnumAttribute<B>::considerUpdateAttributeChange(const Change & c, Enu { EnumIndex idx; if (!this->_enumStore.find_index(c._data.raw(), idx)) { - c._enumScratchPad = inserter.insert(c._data.raw()).ref(); + c.setEnum(inserter.insert(c._data.raw()).ref()); } else { - c._enumScratchPad = idx.ref(); + c.setEnum(idx.ref()); } considerUpdateAttributeChange(c); // for numeric } @@ -166,7 +166,11 @@ SingleValueEnumAttribute<B>::applyUpdateValueChange(const Change& c, EnumStoreBa { EnumIndex oldIdx = _enumIndices[c._doc]; EnumIndex newIdx; - this->_enumStore.find_index(c._data.raw(), newIdx); + if (c.isEnumValid()) { + newIdx = EnumIndex(vespalib::datastore::EntryRef(c.getEnum())); + } else { + this->_enumStore.find_index(c._data.raw(), newIdx); + } updateEnumRefCounts(c, newIdx, oldIdx, updater); } diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp index 0c3e7aa92d5..55a82210a96 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp @@ -38,9 +38,9 @@ SingleValueNumericEnumAttribute<B>::considerArithmeticAttributeChange(const Chan EnumIndex idx; if (!this->_enumStore.find_index(newValue, idx)) { - c._enumScratchPad = inserter.insert(newValue).ref(); + c.setEnum(inserter.insert(newValue).ref()); } else { - c._enumScratchPad = idx.ref(); + c.setEnum(idx.ref()); } _currDocValues[c._doc] = newValue; diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.hpp index 64421b16b8b..12138b0cfbc 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.hpp @@ -46,7 +46,11 @@ SingleValueNumericPostingAttribute<B>::applyUpdateValueChange(const Change & c, std::map<DocId, EnumIndex> & currEnumIndices) { EnumIndex newIdx; - enumStore.find_index(c._data.raw(), newIdx); + if (c.isEnumValid()) { + newIdx = EnumIndex(vespalib::datastore::EntryRef(c.getEnum())); + } else { + enumStore.find_index(c._data.raw(), newIdx); + } currEnumIndices[c._doc] = newIdx; } diff --git a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp index 70d97d7b64c..af31295d083 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp @@ -44,7 +44,11 @@ SingleValueStringPostingAttributeT<B>::applyUpdateValueChange(const Change & c, std::map<DocId, EnumIndex> &currEnumIndices) { EnumIndex newIdx; - enumStore.find_index(c._data.raw(), newIdx); + if (c.isEnumValid()) { + newIdx = EnumIndex(vespalib::datastore::EntryRef(c.getEnum())); + } else { + enumStore.find_index(c._data.raw(), newIdx); + } currEnumIndices[c._doc] = newIdx; } |