Class QueryAnswerResult
java.lang.Object
com.azure.search.documents.models.QueryAnswerResult
- All Implemented Interfaces:
com.azure.json.JsonSerializable<QueryAnswerResult>
public final class QueryAnswerResult
extends Object
implements com.azure.json.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QueryAnswerResultfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of QueryAnswerResult from the JsonReader.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.getKey()Get the key property: The key of the document the answer was extracted from.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.getText()Get the text property: The text passage extracted from the document contents as the answer.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
QueryAnswerResult
public QueryAnswerResult()Creates an instance of QueryAnswerResult class.
-
-
Method Details
-
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
Get the key property: The key of the document the answer was extracted from.- Returns:
- the key value.
-
getText
Get the text property: The text passage extracted from the document contents as the answer.- Returns:
- the text value.
-
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
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.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<QueryAnswerResult>- Throws:
IOException
-
fromJson
Reads an instance of QueryAnswerResult from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of QueryAnswerResult if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the QueryAnswerResult.
-