Closed
Description
Hi Team,
We have one use case where we have to check and need to do some handling on the basis of total shards and successful shards. So it will be good if we can expose them from org.springframework.data.elasticsearch.core.SearchHits
`/*
public interface SearchHits extends Streamable<SearchHit> {
/**
* @return the aggregations.
*/
@Nullable
AggregationsContainer<?> getAggregations();
/**
* @return the maximum score
*/
float getMaxScore();
/**
* @param index position in List.
* @return the {@link SearchHit} at position {index}
* @throws IndexOutOfBoundsException on invalid index
*/
SearchHit<T> getSearchHit(int index);
/**
* @return the contained {@link SearchHit}s.
*/
List<SearchHit<T>> getSearchHits();
/**
* @return the number of total hits.
*/
long getTotalHits();
/**
* @return the relation for the total hits
*/
TotalHitsRelation getTotalHitsRelation();
/**
* @return true if aggregations are available
*/
default boolean hasAggregations() {
return getAggregations() != null;
}
/**
* @return whether the {@link SearchHits} has search hits.
*/
default boolean hasSearchHits() {
return !getSearchHits().isEmpty();
}
/**
* @return the suggest response
* @since 4.3
*/
@Nullable
Suggest getSuggest();
/**
* @return wether the {@link SearchHits} has a suggest response.
* @since 4.3
*/
default boolean hasSuggest() {
return getSuggest() != null;
}
/**
* @return an iterator for {@link SearchHit}
*/
default Iterator<SearchHit<T>> iterator() {
return getSearchHits().iterator();
}
}
`