org.elasticsearch.search.internal
Class InternalSearchHits

java.lang.Object
  extended by org.elasticsearch.search.internal.InternalSearchHits
All Implemented Interfaces:
Iterable<SearchHit>, Streamable, ToXContent, SearchHits

public class InternalSearchHits
extends Object
implements SearchHits


Nested Class Summary
static class InternalSearchHits.StreamContext
           
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
static InternalSearchHit[] EMPTY
           
 long totalHits
           
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
InternalSearchHits(InternalSearchHit[] hits, long totalHits, float maxScore)
           
 
Method Summary
 SearchHit getAt(int position)
          Return the hit as the provided position.
 SearchHit[] getHits()
          The hits of the search request (based on the search type, and from / size provided).
 float getMaxScore()
          The maximum score of this query.
 long getTotalHits()
          The total number of hits that matches the search request.
 SearchHit[] hits()
          The hits of the search request (based on the search type, and from / size provided).
 InternalSearchHit[] internalHits()
           
 Iterator<SearchHit> iterator()
           
 float maxScore()
          The maximum score of this query.
 void readFrom(StreamInput in)
           
 void readFrom(StreamInput in, InternalSearchHits.StreamContext context)
           
static InternalSearchHits readSearchHits(StreamInput in)
           
static InternalSearchHits readSearchHits(StreamInput in, InternalSearchHits.StreamContext context)
           
 void shardTarget(SearchShardTarget shardTarget)
           
static InternalSearchHits.StreamContext streamContext()
           
 long totalHits()
          The total number of hits that matches the search request.
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 void writeTo(StreamOutput out)
           
 void writeTo(StreamOutput out, InternalSearchHits.StreamContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final InternalSearchHit[] EMPTY

totalHits

public long totalHits
Constructor Detail

InternalSearchHits

public InternalSearchHits(InternalSearchHit[] hits,
                          long totalHits,
                          float maxScore)
Method Detail

streamContext

public static InternalSearchHits.StreamContext streamContext()

shardTarget

public void shardTarget(SearchShardTarget shardTarget)

totalHits

public long totalHits()
Description copied from interface: SearchHits
The total number of hits that matches the search request.

Specified by:
totalHits in interface SearchHits

getTotalHits

public long getTotalHits()
Description copied from interface: SearchHits
The total number of hits that matches the search request.

Specified by:
getTotalHits in interface SearchHits

maxScore

public float maxScore()
Description copied from interface: SearchHits
The maximum score of this query.

Specified by:
maxScore in interface SearchHits

getMaxScore

public float getMaxScore()
Description copied from interface: SearchHits
The maximum score of this query.

Specified by:
getMaxScore in interface SearchHits

hits

public SearchHit[] hits()
Description copied from interface: SearchHits
The hits of the search request (based on the search type, and from / size provided).

Specified by:
hits in interface SearchHits

getAt

public SearchHit getAt(int position)
Description copied from interface: SearchHits
Return the hit as the provided position.

Specified by:
getAt in interface SearchHits

getHits

public SearchHit[] getHits()
Description copied from interface: SearchHits
The hits of the search request (based on the search type, and from / size provided).

Specified by:
getHits in interface SearchHits

iterator

public Iterator<SearchHit> iterator()
Specified by:
iterator in interface Iterable<SearchHit>

internalHits

public InternalSearchHit[] internalHits()

toXContent

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

readSearchHits

public static InternalSearchHits readSearchHits(StreamInput in,
                                                InternalSearchHits.StreamContext context)
                                         throws IOException
Throws:
IOException

readSearchHits

public static InternalSearchHits readSearchHits(StreamInput in)
                                         throws IOException
Throws:
IOException

readFrom

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

readFrom

public void readFrom(StreamInput in,
                     InternalSearchHits.StreamContext context)
              throws IOException
Throws:
IOException

writeTo

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

writeTo

public void writeTo(StreamOutput out,
                    InternalSearchHits.StreamContext context)
             throws IOException
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.