Class SearchResult

java.lang.Object
com.azure.search.documents.models.SearchResult

public final class SearchResult extends Object
Contains a document found by a search query, plus associated metadata.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SearchResult(double score)
    Constructor of SearchResult.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    getDocument(Class<T> modelClass)
    Get the additionalProperties property: Unmatched properties from the message are deserialized this collection.
    Get the documentDebugInfo property: Contains debugging information that can be used to further explore your search results.
    Get the highlights property: Text fragments from the document that indicate the matching search terms, organized by each applicable field; null if hit highlighting was not enabled for the query.
    double
    Get the score property: The relevance score of the document compared to other documents returned by the query.
    Get the semanticSearchResult property: The semantic search results based on the search request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SearchResult

      public SearchResult(double score)
      Constructor of SearchResult.
      Parameters:
      score - The relevance score of the document compared to other documents returned by the query.
  • Method Details

    • getScore

      public double getScore()
      Get the score property: The relevance score of the document compared to other documents returned by the query.
      Returns:
      the score value.
    • getHighlights

      public Map<String,List<String>> getHighlights()
      Get the highlights property: Text fragments from the document that indicate the matching search terms, organized by each applicable field; null if hit highlighting was not enabled for the query.
      Returns:
      the highlights value.
    • getSemanticSearch

      public SemanticSearchResult getSemanticSearch()
      Get the semanticSearchResult property: The semantic search results based on the search request.

      If semantic search wasn't requested this will return a SemanticSearchResult with no values.

      Returns:
      the semanticSearchResult value.
    • getDocumentDebugInfo

      public DocumentDebugInfo getDocumentDebugInfo()
      Get the documentDebugInfo property: Contains debugging information that can be used to further explore your search results.
      Returns:
      the documentDebugInfo value.
    • getDocument

      public <T> T getDocument(Class<T> modelClass)
      Get the additionalProperties property: Unmatched properties from the message are deserialized this collection.
      Type Parameters:
      T - Convert document to the generic type.
      Parameters:
      modelClass - The model class converts to.
      Returns:
      the additionalProperties value.
      Throws:
      RuntimeException - if there is IO error occurs.