public class InternalSearchHits extends java.lang.Object implements SearchHits
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static InternalSearchHit[] |
EMPTY |
long |
totalHits |
EMPTY_PARAMS
Constructor and Description |
---|
InternalSearchHits(InternalSearchHit[] hits,
long totalHits,
float maxScore) |
Modifier and Type | Method and Description |
---|---|
static InternalSearchHits |
empty() |
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() |
java.util.Iterator<SearchHit> |
iterator() |
float |
maxScore()
The maximum score of this query.
|
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
static InternalSearchHits |
readSearchHits(StreamInput in) |
void |
shardTarget(SearchShardTarget shardTarget) |
long |
totalHits()
The total number of hits that matches the search request.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
public static final InternalSearchHit[] EMPTY
public long totalHits
public InternalSearchHits(InternalSearchHit[] hits, long totalHits, float maxScore)
public static InternalSearchHits empty()
public void shardTarget(SearchShardTarget shardTarget)
public long totalHits()
SearchHits
totalHits
in interface SearchHits
public long getTotalHits()
SearchHits
getTotalHits
in interface SearchHits
public float maxScore()
SearchHits
maxScore
in interface SearchHits
public float getMaxScore()
SearchHits
getMaxScore
in interface SearchHits
public SearchHit[] hits()
SearchHits
hits
in interface SearchHits
public SearchHit getAt(int position)
SearchHits
getAt
in interface SearchHits
public SearchHit[] getHits()
SearchHits
getHits
in interface SearchHits
public java.util.Iterator<SearchHit> iterator()
iterator
in interface java.lang.Iterable<SearchHit>
public InternalSearchHit[] internalHits()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public static InternalSearchHits readSearchHits(StreamInput in) throws java.io.IOException
java.io.IOException
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
java.io.IOException