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
-
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
-
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 currentSearchResponse
ornull
if not available.long
getStartTime()
When this response was created as a timestamp in milliseconds since epoch.boolean
isPartial()
Returnstrue
if theSearchResponse
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)
-
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 currentSearchResponse
ornull
if not available. SeeisPartial()
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()Returnstrue
if theSearchResponse
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 offalse
indicates that the response is final even ifisPartial()
returnstrue
. 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 interfaceorg.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 classjava.lang.Object
-