Class UpdateHelper


  • public class UpdateHelper
    extends java.lang.Object
    Helper for translating an update request to an index, delete request or update response.
    • Method Summary

      Modifier and Type Method Description
      static GetResult extractGetResult​(UpdateRequest request, java.lang.String concreteIndex, long seqNo, long primaryTerm, 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.
      UpdateHelper.Result prepare​(UpdateRequest request, IndexShard indexShard, boolean canUseIfSeqNo, java.util.function.LongSupplier nowInMillis)
      Prepares an update request by converting it into an index or delete request or an update response (no action).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UpdateHelper

        public UpdateHelper​(ScriptService scriptService)
    • Method Detail

      • prepare

        public UpdateHelper.Result prepare​(UpdateRequest request,
                                           IndexShard indexShard,
                                           boolean canUseIfSeqNo,
                                           java.util.function.LongSupplier nowInMillis)
        Prepares an update request by converting it into an index or delete request or an update response (no action).
      • extractGetResult

        public static GetResult extractGetResult​(UpdateRequest request,
                                                 java.lang.String concreteIndex,
                                                 long seqNo,
                                                 long primaryTerm,
                                                 long version,
                                                 java.util.Map<java.lang.String,​java.lang.Object> source,
                                                 XContentType sourceContentType,
                                                 @Nullable
                                                 BytesReference sourceAsBytes)
        Applies 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