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, 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.
 int getTotalShards()
          The total number of shards the search was executed on.
 SearchHits hits()
          The search hits.
 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.
 int successfulShards()
          The successful number of shards the search was executed on.
 int totalShards()
          The total number of shards the search was executed on.
 void toXContent(XContentBuilder builder, ToXContent.Params params)
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchResponse

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

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.


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 void 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