java.lang.Iterable<SearchHit>
, Streamable
, ToXContent
, ToXContentFragment
public final class SearchHits extends java.lang.Object implements Streamable, ToXContentFragment, java.lang.Iterable<SearchHit>
Modifier and Type | Class | Description |
---|---|---|
static class |
SearchHits.Fields |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field | Description |
---|---|---|
static SearchHit[] |
EMPTY |
|
long |
totalHits |
EMPTY_PARAMS
Constructor | Description |
---|---|
SearchHits(SearchHit[] hits,
long totalHits,
float maxScore) |
Modifier and Type | Method | Description |
---|---|---|
static SearchHits |
empty() |
|
boolean |
equals(java.lang.Object obj) |
|
static SearchHits |
fromXContent(XContentParser parser) |
|
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.
|
int |
hashCode() |
|
java.util.Iterator<SearchHit> |
iterator() |
|
void |
readFrom(StreamInput in) |
Set this object's fields from a StreamInput.
|
static SearchHits |
readSearchHits(StreamInput in) |
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
newWriteableReader
isFragment
public static final SearchHit[] EMPTY
public long totalHits
public SearchHits(SearchHit[] hits, long totalHits, float maxScore)
public static SearchHits empty()
public long getTotalHits()
public float getMaxScore()
public SearchHit[] getHits()
public SearchHit getAt(int position)
public java.util.Iterator<SearchHit> iterator()
iterator
in interface java.lang.Iterable<SearchHit>
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public static SearchHits fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException
public static SearchHits 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
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object