QueryAnswerResult Class
- java.
lang. Object - com.
azure. search. documents. models. QueryAnswerResult
- com.
Implements
public final class QueryAnswerResult
implements JsonSerializable<QueryAnswerResult>
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
Constructor | Description |
---|---|
QueryAnswerResult() |
Creates an instance of Query |
Method Summary
Modifier and Type | Method and Description |
---|---|
static
Query |
fromJson(JsonReader jsonReader)
Reads an instance of Query |
Map<String,Object> |
getAdditionalProperties()
Get the additional |
String |
getHighlights()
Get the highlights property: Same text passage as in the Text property with highlighted text phrases most relevant to the query. |
String |
getKey()
Get the key property: The key of the document the answer was extracted from. |
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. |
String |
getText()
Get the text property: The text passage extracted from the document contents as the answer. |
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Constructor Details
QueryAnswerResult
public QueryAnswerResult()
Creates an instance of QueryAnswerResult class.
Method Details
fromJson
public static QueryAnswerResult fromJson(JsonReader jsonReader)
Reads an instance of QueryAnswerResult from the JsonReader.
Parameters:
Returns:
Throws:
getAdditionalProperties
public Map
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:
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:
getKey
public String getKey()
Get the key property: The key of the document the answer was extracted from.
Returns:
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:
getText
public String getText()
Get the text property: The text passage extracted from the document contents as the answer.
Returns:
toJson
Applies to
Azure SDK for Java