java.lang.Iterable<SearchHit>, Streamable, ToXContent, ToXContentFragmentpublic 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, waitnewWriteableReaderisFragmentpublic 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 ToXContentjava.io.IOExceptionpublic static SearchHits fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOExceptionpublic static SearchHits readSearchHits(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic void readFrom(StreamInput in) throws java.io.IOException
StreamablereadFrom in interface Streamablejava.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
StreamablewriteTo in interface Streamablejava.io.IOExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object