Interface SearchDocument

All Superinterfaces:
Document, Map<String,Object>, StringObjectMap<Document>
All Known Implementing Classes:
SearchDocumentAdapter

public interface SearchDocument extends Document
Extension to Document exposing search response related data.
Since:
4.0
Author:
Mark Paluch, Peter-Josef Meisch, Matt Gilene
See Also:
  • Method Details

    • getScore

      float getScore()
      Return the search score.
      Returns:
      the search score.
    • getFields

      Map<String,List<Object>> getFields()
      Returns:
      the fields for the search result, not null
    • getFieldValue

      @Nullable default <V> V getFieldValue(String name)
      The first value of the given field.
      Parameters:
      name - the field name
    • getSortValues

      @Nullable default Object[] getSortValues()
      Returns:
      the sort values for the search hit
    • getHighlightFields

      @Nullable default Map<String,List<String>> getHighlightFields()
      Returns:
      the highlightFields for the search hit.
    • getInnerHits

      @Nullable default Map<String,SearchDocumentResponse> getInnerHits()
      Returns:
      the innerHits for the SearchHit
      Since:
      4.1
    • getNestedMetaData

      @Nullable default NestedMetaData getNestedMetaData()
      Returns:
      the nested metadata in case this is a nested inner hit.
      Since:
      4.1
    • getRouting

      @Nullable default String getRouting()
      Returns:
      the routing value for the document
      Since:
      4.2
    • getExplanation

      @Nullable Explanation getExplanation()
      Returns:
      the explanation for the SearchHit.
      Since:
      4.2
    • getMatchedQueries

      @Nullable List<String> getMatchedQueries()
      Returns:
      the matched queries for the SearchHit.