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