public class UpdateHelper extends AbstractComponent
Modifier and Type | Class and Description |
---|---|
static class |
UpdateHelper.ContextFields
Field names used to populate the script context
|
static class |
UpdateHelper.Result |
deprecationLogger, logger, settings
Constructor and Description |
---|
UpdateHelper(Settings settings,
ScriptService scriptService) |
Modifier and Type | Method and 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)
Applies
UpdateRequest.fetchSource() to the _source of the updated document to be returned in a update response. |
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).
|
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).
|
logDeprecatedSetting, logRemovedSetting, nodeName
public UpdateHelper(Settings settings, ScriptService scriptService)
public UpdateHelper.Result prepare(UpdateRequest request, IndexShard indexShard, java.util.function.LongSupplier nowInMillis)
protected UpdateHelper.Result prepare(ShardId shardId, UpdateRequest request, GetResult getResult, java.util.function.LongSupplier nowInMillis)
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)
UpdateRequest.fetchSource()
to the _source of the updated document to be returned in a update response.
For BWC this function also extracts the UpdateRequest.fields()
from the updated document to be returned in a update response