aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2018-10-08 11:25:05 +0200
committerTor Egge <Tor.Egge@broadpark.no>2018-10-08 11:25:05 +0200
commit817b488c6ceb13e65eed3719b4803a23af41afef (patch)
tree56eb319ce7efd9f6e2a5237bbe0ea690089447db /searchcore
parentde3a914eb138ae8b6892e5aa7e0008c10cf667e7 (diff)
Change handling of populating document from multivalue attribute with
zero values for the document. Old behavior: The field was set to an empty array/set if it was present in the document. New behavior: The field is removed from the document.
Diffstat (limited to 'searchcore')
-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();