Class AsyncSearchResponse
java.lang.Object
org.elasticsearch.client.asyncsearch.AsyncSearchResponse
- All Implemented Interfaces:
ToXContent
,ToXContentObject
public class AsyncSearchResponse extends java.lang.Object implements ToXContentObject
A response of an async search request.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
Fields Modifier and Type Field Description static ParseField
ERROR_FIELD
static ParseField
EXPIRATION_FIELD
static ParseField
ID_FIELD
static ParseField
IS_PARTIAL_FIELD
static ParseField
IS_RUNNING_FIELD
static ConstructingObjectParser<AsyncSearchResponse,java.lang.Void>
PARSER
static ParseField
RESPONSE_FIELD
static ParseField
START_TIME_FIELD
-
Method Summary
Modifier and Type Method Description static AsyncSearchResponse
fromXContent(XContentParser parser)
long
getExpirationTime()
When this response will expired as a timestamp in milliseconds since epoch.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.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()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
-
Field Details
-
Method Details
-
getId
Returns the id of the async search request or null if the response is not stored in the cluster. -
getSearchResponse
Returns the currentSearchResponse
ornull
if not available. SeeisPartial()
to determine whether the response contains partial or complete results. -
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 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
fromXContent
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-