Class AsyncSearchResponse

java.lang.Object
org.elasticsearch.client.asyncsearch.AsyncSearchResponse
All Implemented Interfaces:
org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject

public class AsyncSearchResponse
extends java.lang.Object
implements org.elasticsearch.common.xcontent.ToXContentObject
A response of an async search request.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
  • Field Summary

    Fields
    Modifier and Type Field Description
    static org.elasticsearch.common.ParseField ERROR_FIELD  
    static org.elasticsearch.common.ParseField EXPIRATION_FIELD  
    static org.elasticsearch.common.ParseField ID_FIELD  
    static org.elasticsearch.common.ParseField IS_PARTIAL_FIELD  
    static org.elasticsearch.common.ParseField IS_RUNNING_FIELD  
    static org.elasticsearch.common.xcontent.ConstructingObjectParser<AsyncSearchResponse,​java.lang.Void> PARSER  
    static org.elasticsearch.common.ParseField RESPONSE_FIELD  
    static org.elasticsearch.common.ParseField START_TIME_FIELD  

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Method Summary

    Modifier and Type Method Description
    static AsyncSearchResponse fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)  
    long getExpirationTime()
    When this response will expired as a timestamp in milliseconds since epoch.
    org.elasticsearch.ElasticsearchException getFailure()
    Returns the failure reason or null if the query is running or has completed normally.
    java.lang.String getId()
    Returns the id of the async search request or null if the response is not stored in the cluster.
    org.elasticsearch.action.search.SearchResponse getSearchResponse()
    Returns the current SearchResponse or null if not available.
    long getStartTime()
    When this response was created as a timestamp in milliseconds since epoch.
    boolean isPartial()
    Returns true if the SearchResponse contains partial results computed from a subset of the total shards.
    boolean isRunning()
    Whether the search is still running in the cluster.
    java.lang.String toString()  
    org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject

    isFragment
  • Field Details

    • ID_FIELD

      public static final org.elasticsearch.common.ParseField ID_FIELD
    • IS_PARTIAL_FIELD

      public static final org.elasticsearch.common.ParseField IS_PARTIAL_FIELD
    • IS_RUNNING_FIELD

      public static final org.elasticsearch.common.ParseField IS_RUNNING_FIELD
    • START_TIME_FIELD

      public static final org.elasticsearch.common.ParseField START_TIME_FIELD
    • EXPIRATION_FIELD

      public static final org.elasticsearch.common.ParseField EXPIRATION_FIELD
    • RESPONSE_FIELD

      public static final org.elasticsearch.common.ParseField RESPONSE_FIELD
    • ERROR_FIELD

      public static final org.elasticsearch.common.ParseField ERROR_FIELD
    • PARSER

      public static final org.elasticsearch.common.xcontent.ConstructingObjectParser<AsyncSearchResponse,​java.lang.Void> PARSER
  • Method Details

    • getId

      @Nullable public java.lang.String getId()
      Returns the id of the async search request or null if the response is not stored in the cluster.
    • getSearchResponse

      public org.elasticsearch.action.search.SearchResponse getSearchResponse()
      Returns the current SearchResponse or null if not available. See isPartial() to determine whether the response contains partial or complete results.
    • getFailure

      public org.elasticsearch.ElasticsearchException getFailure()
      Returns the failure reason or null if the query is running or has completed normally.
    • isPartial

      public boolean isPartial()
      Returns true if the SearchResponse contains partial results computed from a subset of the total shards.
    • isRunning

      public boolean isRunning()
      Whether the search is still running in the cluster. A value of false indicates that the response is final even if isPartial() returns true. In such case, the partial response represents the status of the search before a non-recoverable failure.
    • getStartTime

      public long getStartTime()
      When this response was created as a timestamp in milliseconds since epoch.
    • getExpirationTime

      public long getExpirationTime()
      When this response will expired as a timestamp in milliseconds since epoch.
    • toXContent

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

      public static AsyncSearchResponse fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object