summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-10-08 11:45:10 +0200
committerGitHub <noreply@github.com>2018-10-08 11:45:10 +0200
commitf39780561e0b1f2eba8c867330f5601c81f6861b (patch)
treeb92ba53f9e9a3fb03500abef04cac38120b83aed
parent59a11d316b9465b1fa8b19604958696e8a955328 (diff)
parent817b488c6ceb13e65eed3719b4803a23af41afef (diff)
Merge pull request #7236 from vespa-engine/toregge/remove-document-field-if-multivalue-attribute-has-zero-values-for-document
Change handling of populating document from multivalue attribute
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/document_field_retriever.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/document_field_retriever.cpp b/searchcore/src/vespa/searchcore/proton/attribute/document_field_retriever.cpp
index 243d36bdead..d05fc98f152 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/document_field_retriever.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/document_field_retriever.cpp
@@ -55,7 +55,8 @@ setValue(DocumentIdT lid,
AttributeContent<T> content;
content.fill(attr, lid);
Field f = doc.getField(fieldName);
- if (!doc.getValue(f) && content.size() == 0) {
+ if (content.size() == 0) {
+ doc.remove(f);
break;
}
FieldValue::UP fv = f.getDataType().createFieldValue();
@@ -75,7 +76,8 @@ setValue(DocumentIdT lid,
AttributeContent<WeightedType<T> > content;
content.fill(attr, lid);
Field f = doc.getField(fieldName);
- if (!doc.getValue(f) && content.size() == 0) {
+ if (content.size() == 0) {
+ doc.remove(f);
break;
}
FieldValue::UP fv = f.getDataType().createFieldValue();