Class BulkResponse

All Implemented Interfaces:
Iterable<BulkItemResponse>, Writeable, StatusToXContentObject, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, org.elasticsearch.core.RefCounted

public class BulkResponse extends ActionResponse implements Iterable<BulkItemResponse>, StatusToXContentObject
A response of a bulk execution. Holding a response for each item responding (in order) of the bulk requests. Each item holds the index/type/id is operated on, and if it failed or not (with the failure message).
  • Field Details

  • Constructor Details

  • Method Details

    • getTook

      public org.elasticsearch.core.TimeValue getTook()
      How long the bulk execution took. Excluding ingest preprocessing.
    • getIngestTook

      public org.elasticsearch.core.TimeValue getIngestTook()
      If ingest is enabled returns the bulk ingest preprocessing time, otherwise 0 is returned.
    • getIngestTookInMillis

      public long getIngestTookInMillis()
      If ingest is enabled returns the bulk ingest preprocessing time. in milliseconds, otherwise -1 is returned.
    • hasFailures

      public boolean hasFailures()
      Has anything failed with the execution.
    • buildFailureMessage

      public String buildFailureMessage()
    • getItems

      public BulkItemResponse[] getItems()
      The items representing each action performed in the bulk operation (in the same order!).
    • iterator

      public Iterator<BulkItemResponse> iterator()
      Specified by:
      iterator in interface Iterable<BulkItemResponse>
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • status

      public RestStatus status()
      Description copied from interface: StatusToXContentObject
      Returns the REST status to make sure it is returned correctly
      Specified by:
      status in interface StatusToXContentObject
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      IOException
    • fromXContent

      public static BulkResponse fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException