T
- the result data class.public class SearchHits<T> extends Object implements Streamable<SearchHit<T>>
SearchHit
s with additional information from the search.Modifier and Type | Class and Description |
---|---|
static class |
SearchHits.TotalHitsRelation
Enum to represent the relation that Elasticsearch returns for the totalHits value Ekasticsearch
docs
|
Constructor and Description |
---|
SearchHits(long totalHits,
SearchHits.TotalHitsRelation totalHitsRelation,
float maxScore,
String scrollId,
List<? extends SearchHit<T>> searchHits,
org.elasticsearch.search.aggregations.Aggregations aggregations) |
Modifier and Type | Method and Description |
---|---|
org.elasticsearch.search.aggregations.Aggregations |
getAggregations() |
float |
getMaxScore() |
String |
getScrollId() |
SearchHit<T> |
getSearchHit(int index) |
List<SearchHit<T>> |
getSearchHits() |
long |
getTotalHits() |
SearchHits.TotalHitsRelation |
getTotalHitsRelation() |
boolean |
hasAggregations() |
Iterator<SearchHit<T>> |
iterator() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
and, and, and, and, empty, filter, flatMap, get, isEmpty, map, of, of, of, stream, toList, toSet, toStreamable, toStreamable
forEach, spliterator
public SearchHits(long totalHits, SearchHits.TotalHitsRelation totalHitsRelation, float maxScore, @Nullable String scrollId, List<? extends SearchHit<T>> searchHits, @Nullable org.elasticsearch.search.aggregations.Aggregations aggregations)
totalHits
- the number of total hits for the searchtotalHitsRelation
- the relation SearchHits.TotalHitsRelation
, must not be nullmaxScore
- the maximum scorescrollId
- the scroll id if availablesearchHits
- must not be nullaggregations
- the aggregations if availablepublic long getTotalHits()
public SearchHits.TotalHitsRelation getTotalHitsRelation()
public float getMaxScore()
public SearchHit<T> getSearchHit(int index)
index
- position in List.SearchHit
at position {index}IndexOutOfBoundsException
- on invalid indexpublic boolean hasAggregations()
@Nullable public org.elasticsearch.search.aggregations.Aggregations getAggregations()
Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.