Class SearchHits

    • Field Detail

      • EMPTY

        public static final SearchHit[] EMPTY
      • totalHits

        public long totalHits
    • Constructor Detail

      • SearchHits

        public SearchHits​(SearchHit[] hits,
                          long totalHits,
                          float maxScore)
      • SearchHits

        public SearchHits​(SearchHit[] hits,
                          long totalHits,
                          float maxScore,
                [] sortFields,
                          java.lang.String collapseField,
                          java.lang.Object[] collapseValues)
    • Method Detail

      • getTotalHits

        public long getTotalHits()
        The total number of hits that matches the search request.
      • getMaxScore

        public float getMaxScore()
        The maximum score of this query.
      • getHits

        public SearchHit[] getHits()
        The hits of the search request (based on the search type, and from / size provided).
      • getAt

        public SearchHit getAt​(int position)
        Return the hit as the provided position.
      • getSortFields

        public[] getSortFields()
        In case documents were sorted by field(s), returns information about such field(s), null otherwise
        See Also:
      • getCollapseField

        public java.lang.String getCollapseField()
        In case field collapsing was performed, returns the field used for field collapsing, null otherwise
      • getCollapseValues

        public java.lang.Object[] getCollapseValues()
        In case field collapsing was performed, returns the values of the field that field collapsing was performed on, null otherwise
      • iterator

        public java.util.Iterator<SearchHit> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<SearchHit>
      • fromXContent

        public static SearchHits fromXContent​(XContentParser parser)
      • readSearchHits

        public static SearchHits readSearchHits​(StreamInput in)
      • equals

        public boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object