Class AsyncStatusResponse

All Implemented Interfaces:
Writeable, org.elasticsearch.core.RefCounted, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject, SearchStatusResponse

public class AsyncStatusResponse extends ActionResponse implements SearchStatusResponse, org.elasticsearch.xcontent.ToXContentObject
A response of an async search status request.
  • Constructor Details

    • AsyncStatusResponse

      public AsyncStatusResponse(String id, boolean isRunning, boolean isPartial, long startTimeMillis, long expirationTimeMillis, Long completionTimeMillis, int totalShards, int successfulShards, int skippedShards, int failedShards, RestStatus completionStatus, SearchResponse.Clusters clusters)
    • AsyncStatusResponse

      public AsyncStatusResponse(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • getStatusFromStoredSearch

      public static AsyncStatusResponse getStatusFromStoredSearch(AsyncSearchResponse asyncSearchResponse, long expirationTimeMillis, String id)
      Get status from the stored async search response
      Parameters:
      asyncSearchResponse - stored async search response
      expirationTimeMillis - – expiration time in milliseconds
      id - – encoded async search id
      Returns:
      status response
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Returns the id of the async search status request.
    • isRunning

      public boolean isRunning()
      Returns true if the search is still running in the cluster, or false if the search has been completed.
    • isPartial

      public boolean isPartial()
      Returns true if the search results are partial. This could be either because async search hasn't finished yet, or if it finished and some shards have failed.
    • getStartTime

      public long getStartTime()
      Returns a timestamp when the search tasks started, in milliseconds since epoch.
    • getExpirationTime

      public long getExpirationTime()
      Returns a timestamp when the search will be expired, in milliseconds since epoch.
      Specified by:
      getExpirationTime in interface SearchStatusResponse
    • getCompletionTime

      public Long getCompletionTime()
      Returns:
      completion_time_in_millis if set, otherwise null
    • getTotalShards

      public int getTotalShards()
      Returns the total number of shards the search is executed on.
    • getSuccessfulShards

      public int getSuccessfulShards()
      Returns the number of successful shards the search was executed on.
    • getSkippedShards

      public int getSkippedShards()
      Returns the number of skipped shards due to pre-filtering.
    • getFailedShards

      public int getFailedShards()
      Returns the number of failed shards the search was executed on.
    • getCompletionStatus

      public RestStatus getCompletionStatus()
      For a completed async search returns the completion status. For a still running async search returns null.
    • getClusters

      public SearchResponse.Clusters getClusters()
      Returns:
      For CCS, clusters object that has information about the clustes being searched, such as total count successful count and skipped. Will be null for local-only searches.