Package org.elasticsearch.action.update
Class UpdateHelper
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.action.update.UpdateHelper
-
public class UpdateHelper extends AbstractComponent
Helper for translating an update request to an index, delete request or update response.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UpdateHelper.ContextFields
Field names used to populate the script contextstatic class
UpdateHelper.Result
-
Field Summary
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
deprecationLogger, logger, settings
-
-
Constructor Summary
Constructors Constructor Description UpdateHelper(Settings settings, ScriptService scriptService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GetResult
extractGetResult(UpdateRequest request, java.lang.String concreteIndex, long version, java.util.Map<java.lang.String,java.lang.Object> source, XContentType sourceContentType, BytesReference sourceAsBytes)
AppliesUpdateRequest.fetchSource()
to the _source of the updated document to be returned in a update response.UpdateHelper.Result
prepare(UpdateRequest request, IndexShard indexShard, java.util.function.LongSupplier nowInMillis)
Prepares an update request by converting it into an index or delete request or an update response (no action).protected UpdateHelper.Result
prepare(ShardId shardId, UpdateRequest request, GetResult getResult, java.util.function.LongSupplier nowInMillis)
Prepares an update request by converting it into an index or delete request or an update response (no action, in the event of a noop).-
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
logDeprecatedSetting, logRemovedSetting, nodeName
-
-
-
-
Constructor Detail
-
UpdateHelper
public UpdateHelper(Settings settings, ScriptService scriptService)
-
-
Method Detail
-
prepare
public UpdateHelper.Result prepare(UpdateRequest request, IndexShard indexShard, java.util.function.LongSupplier nowInMillis)
Prepares an update request by converting it into an index or delete request or an update response (no action).
-
prepare
protected UpdateHelper.Result prepare(ShardId shardId, UpdateRequest request, GetResult getResult, java.util.function.LongSupplier nowInMillis)
Prepares an update request by converting it into an index or delete request or an update response (no action, in the event of a noop).
-
extractGetResult
public static GetResult extractGetResult(UpdateRequest request, java.lang.String concreteIndex, long version, java.util.Map<java.lang.String,java.lang.Object> source, XContentType sourceContentType, @Nullable BytesReference sourceAsBytes)
AppliesUpdateRequest.fetchSource()
to the _source of the updated document to be returned in a update response. For BWC this function also extracts theUpdateRequest.fields()
from the updated document to be returned in a update response
-
-