Class AnswerResult

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

public final class AnswerResult extends Object
An answer is a text passage extracted from the contents of the most relevant documents that matched the query. Answers are extracted from the top search results. Answer candidates are scored and the top answers are selected.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the additionalProperties property: An answer is a text passage extracted from the contents of the most relevant documents that matched the query.
    Get the highlights property: Same text passage as in the Text property with highlighted text phrases most relevant to the query.
    Get the key property: The key of the document the answer was extracted from.
    Get the score property: The score value represents how relevant the answer is to the query relative to other answers returned for the query.
    Get the text property: The text passage extracted from the document contents as the answer.
    setAdditionalProperties(Map<String,Object> additionalProperties)
    Set the additionalProperties property: An answer is a text passage extracted from the contents of the most relevant documents that matched the query.

    Methods inherited from class java.lang.Object

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

    • AnswerResult

      public AnswerResult()
  • Method Details

    • getScore

      public Double getScore()
      Get the score property: The score value represents how relevant the answer is to the query relative to other answers returned for the query.
      Returns:
      the score value.
    • getKey

      public String getKey()
      Get the key property: The key of the document the answer was extracted from.
      Returns:
      the key value.
    • getText

      public String getText()
      Get the text property: The text passage extracted from the document contents as the answer.
      Returns:
      the text value.
    • getHighlights

      public String getHighlights()
      Get the highlights property: Same text passage as in the Text property with highlighted text phrases most relevant to the query.
      Returns:
      the highlights value.
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
      Get the additionalProperties property: An answer is a text passage extracted from the contents of the most relevant documents that matched the query. Answers are extracted from the top search results. Answer candidates are scored and the top answers are selected.
      Returns:
      the additionalProperties value.
    • setAdditionalProperties

      public AnswerResult setAdditionalProperties(Map<String,Object> additionalProperties)
      Set the additionalProperties property: An answer is a text passage extracted from the contents of the most relevant documents that matched the query. Answers are extracted from the top search results. Answer candidates are scored and the top answers are selected.
      Parameters:
      additionalProperties - the additionalProperties value to set.
      Returns:
      the AnswerResult object itself.