org.elasticsearch.action.search
Class SearchResponse

java.lang.Object
  extended by org.elasticsearch.action.search.SearchResponse
All Implemented Interfaces:
ActionResponse, Streamable, ToXContent

public class SearchResponse
extends java.lang.Object
implements ActionResponse, ToXContent

A response of a search request.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
SearchResponse(InternalSearchResponse internalResponse, java.lang.String scrollId, int totalShards, int successfulShards, long tookInMillis, ShardSearchFailure[] shardFailures)
           
 
Method Summary
 Facets facets()
          The search facets.
 int failedShards()
          The failed number of shards the search was executed on.
 Facets getFacets()
          The search facets.
 int getFailedShards()
          The failed number of shards the search was executed on.
 SearchHits getHits()
          The search hits.
 java.lang.String getScrollId()
          If scrolling was enabled (SearchRequest.scroll(org.elasticsearch.search.Scroll), the scroll id that can be used to continue scrolling.
 ShardSearchFailure[] getShardFailures()
          The failures that occurred during the search.
 int getSuccessfulShards()
          The successful number of shards the search was executed on.
 TimeValue getTook()
          How long the search took.
 long getTookInMillis()
          How long the search took in milliseconds.
 int getTotalShards()
          The total number of shards the search was executed on.
 SearchHits hits()
          The search hits.
 boolean isTimedOut()
          Has the search operation timed out.
 void readFrom(StreamInput in)
           
static SearchResponse readSearchResponse(StreamInput in)
           
 java.lang.String scrollId()
          If scrolling was enabled (SearchRequest.scroll(org.elasticsearch.search.Scroll), the scroll id that can be used to continue scrolling.
 ShardSearchFailure[] shardFailures()
          The failures that occurred during the search.
 RestStatus status()
           
 int successfulShards()
          The successful number of shards the search was executed on.
 boolean timedOut()
          Has the search operation timed out.
 TimeValue took()
          How long the search took.
 long tookInMillis()
          How long the search took in milliseconds.
 java.lang.String toString()
           
 int totalShards()
          The total number of shards the search was executed on.
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchResponse

public SearchResponse(InternalSearchResponse internalResponse,
                      java.lang.String scrollId,
                      int totalShards,
                      int successfulShards,
                      long tookInMillis,
                      ShardSearchFailure[] shardFailures)
Method Detail

status

public RestStatus status()

hits

public SearchHits hits()
The search hits.


getHits

public SearchHits getHits()
The search hits.


facets

public Facets facets()
The search facets.


getFacets

public Facets getFacets()
The search facets.


timedOut

public boolean timedOut()
Has the search operation timed out.


isTimedOut

public boolean isTimedOut()
Has the search operation timed out.


took

public TimeValue took()
How long the search took.


getTook

public TimeValue getTook()
How long the search took.


tookInMillis

public long tookInMillis()
How long the search took in milliseconds.


getTookInMillis

public long getTookInMillis()
How long the search took in milliseconds.


totalShards

public int totalShards()
The total number of shards the search was executed on.


getTotalShards

public int getTotalShards()
The total number of shards the search was executed on.


successfulShards

public int successfulShards()
The successful number of shards the search was executed on.


getSuccessfulShards

public int getSuccessfulShards()
The successful number of shards the search was executed on.


failedShards

public int failedShards()
The failed number of shards the search was executed on.


getFailedShards

public int getFailedShards()
The failed number of shards the search was executed on.


shardFailures

public ShardSearchFailure[] shardFailures()
The failures that occurred during the search.


getShardFailures

public ShardSearchFailure[] getShardFailures()
The failures that occurred during the search.


scrollId

public java.lang.String scrollId()
If scrolling was enabled (SearchRequest.scroll(org.elasticsearch.search.Scroll), the scroll id that can be used to continue scrolling.


getScrollId

public java.lang.String getScrollId()
If scrolling was enabled (SearchRequest.scroll(org.elasticsearch.search.Scroll), the scroll id that can be used to continue scrolling.


toXContent

public XContentBuilder toXContent(XContentBuilder builder,
                                  ToXContent.Params params)
                           throws java.io.IOException
Specified by:
toXContent in interface ToXContent
Throws:
java.io.IOException

readSearchResponse

public static SearchResponse readSearchResponse(StreamInput in)
                                         throws java.io.IOException
Throws:
java.io.IOException

readFrom

public void readFrom(StreamInput in)
              throws java.io.IOException
Specified by:
readFrom in interface Streamable
Throws:
java.io.IOException

writeTo

public void writeTo(StreamOutput out)
             throws java.io.IOException
Specified by:
writeTo in interface Streamable
Throws:
java.io.IOException

toString

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