diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-09-14 19:38:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-14 19:38:45 +0200 |
commit | 0f4aa6b514bcca1ed48969680c71e740448fce85 (patch) | |
tree | ee21c3c53a9fb50a1c065e3b1472e1f4762ababa /docprocs/src/main/java/com | |
parent | 1d96a18bb0079b626af384748164c15dbee92c8c (diff) |
Revert "Revert "Do not expose fieldupdates as a list. Hide implementation details ins…""
Diffstat (limited to 'docprocs/src/main/java/com')
-rw-r--r-- | docprocs/src/main/java/com/yahoo/docprocs/indexing/DocumentScript.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/docprocs/src/main/java/com/yahoo/docprocs/indexing/DocumentScript.java b/docprocs/src/main/java/com/yahoo/docprocs/indexing/DocumentScript.java index f25603deee9..4905f3d9dad 100644 --- a/docprocs/src/main/java/com/yahoo/docprocs/indexing/DocumentScript.java +++ b/docprocs/src/main/java/com/yahoo/docprocs/indexing/DocumentScript.java @@ -9,7 +9,6 @@ import com.yahoo.document.datatypes.Array; import com.yahoo.document.datatypes.FieldValue; import com.yahoo.document.datatypes.MapFieldValue; import com.yahoo.document.datatypes.StringFieldValue; -import com.yahoo.document.datatypes.Struct; import com.yahoo.document.datatypes.StructuredFieldValue; import com.yahoo.document.datatypes.WeightedSet; import com.yahoo.document.fieldpathupdate.AssignFieldPathUpdate; @@ -20,7 +19,11 @@ import com.yahoo.document.update.ValueUpdate; import com.yahoo.vespa.indexinglanguage.AdapterFactory; import com.yahoo.vespa.indexinglanguage.expressions.Expression; -import java.util.*; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; /** * @author Simon Thoresen Hult @@ -48,13 +51,13 @@ public class DocumentScript { } public DocumentUpdate execute(AdapterFactory adapterFactory, DocumentUpdate update) { - for (FieldUpdate fieldUpdate : update.getFieldUpdates()) { + for (FieldUpdate fieldUpdate : update.fieldUpdates()) { requireThatFieldIsDeclaredInDocument(fieldUpdate.getField()); for (ValueUpdate<?> valueUpdate : fieldUpdate.getValueUpdates()) { removeAnyLinguisticsSpanTree(valueUpdate); } } - for (FieldPathUpdate fieldUpdate : update.getFieldPathUpdates()) { + for (FieldPathUpdate fieldUpdate : update.fieldPathUpdates()) { requireThatFieldIsDeclaredInDocument(fieldUpdate.getFieldPath().get(0).getFieldRef()); if (fieldUpdate instanceof AssignFieldPathUpdate) { removeAnyLinguisticsSpanTree(((AssignFieldPathUpdate)fieldUpdate).getFieldValue()); |