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

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

      default <V> @Nullable List<V> getFieldValues(String name)
      Type Parameters:
      V - the type of elements
      Parameters:
      name - the field name
      Returns:
      the values of the given field.
    • getSortValues

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

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

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

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

      default @Nullable 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 Map<String,Double> getMatchedQueries()
      Returns:
      the matched queries for the SearchHit.