Class QueryAnswer
java.lang.Object
com.azure.search.documents.models.QueryAnswer
Configuration for how semantic search returns answers to the search.
-
Constructor Summary
ConstructorsConstructorDescriptionQueryAnswer(QueryAnswerType answerType) Creates a new instance ofQueryAnswer. -
Method Summary
Modifier and TypeMethodDescriptionGets the type of answers to generate.getCount()Gets the number of answers to generate.Gets the confidence threshold an answer must match to be included as an answer to the query of answers.Sets the number of answers to generate.setThreshold(Double threshold) Sets the confidence threshold an answer must match to be included as an answer to the query of answers.
-
Constructor Details
-
QueryAnswer
Creates a new instance ofQueryAnswer.- Parameters:
answerType- The type of answers to generate.
-
-
Method Details
-
getAnswerType
Gets the type of answers to generate.- Returns:
- The type of answers to generate.
-
getCount
Gets the number of answers to generate.The number of answers to return is optional and will default to 1.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Returns:
- The number of answers to generate.
-
setCount
Sets the number of answers to generate.The number of answers to return is optional and will default to 1.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Parameters:
count- The number of answers to generate.- Returns:
- The QueryAnswer object itself.
-
getThreshold
Gets the confidence threshold an answer must match to be included as an answer to the query of answers.The threshold is optional and will default to 0.7.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Returns:
- The confidence threshold an answer must match to be included as an answer to the query of answers.
-
setThreshold
Sets the confidence threshold an answer must match to be included as an answer to the query of answers.The threshold is optional and will default to 0.7.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Parameters:
threshold- The confidence threshold an answer must match to be included as an answer to the query of answers.- Returns:
- The QueryAnswer object itself.
-