The Questions interface
In Sitecore Search, you can have your search query return questions and answers related to a keyphrase. Use the following objects and methods for AI generated content.
Questions interface
|
Name |
Type |
Description |
|---|---|---|
|
|
string |
Phrase used to search questions to be returned. |
|
exact_answer |
ExactAnswer |
Object describing the type of values to return. |
|
|
RelatedQuestions |
Object describing how many and which questions to include in response. |
RelatedQuestions interface
|
Name |
Type |
Description |
|---|---|---|
|
|
number |
Maximum number of question and answer pairs. Default: 5 |
|
|
number |
Number of question and answer pairs to omit before the beginning of the set returned. |
ExactAnswer interface
|
Name |
Type |
Description |
|---|---|---|
|
|
string |
Describes the type of values to generate. question, statement, or keyword. |
Unless indicated otherwise, all values are optional.
ISearchRequest methods
The following code block lists the various methods related to the Questions interface and is accessible through the WidgetRequest object. After the installation of the JS Data package into your project, these methods and their documentation are available in your IDE.
/** questions */
getQuestions(): Questions;
setQuestions(value: Questions): IWidgetItem;
resetQuestions(): IWidgetItem;
updateQuestions(value: Questions): IWidgetItem;
/** questions.exact_answer */
getQuestionsExactAnswer(): ExactAnswer;
setQuestionsExactAnswer(value: ExactAnswer): IWidgetItem;
resetQuestionsExactAnswer(): IWidgetItem;
updateQuestionsExactAnswer(value: ExactAnswer): IWidgetItem;
/** questions.exact_answer.query_types */
getQuestionsExactAnswerQueryTypes(): string;
setQuestionsExactAnswerQueryTypes(value: string): IWidgetItem;
resetQuestionsExactAnswerQueryTypes(): IWidgetItem;
/** questions.keyphrase */
getQuestionsKeyphrase(): string;
setQuestionsKeyphrase(value: string): IWidgetItem;
resetQuestionsKeyphrase(): IWidgetItem;
/** questions.related_questions */
getQuestionsRelatedQuestions(): RelatedQuestions;
setQuestionsRelatedQuestions(value: RelatedQuestions): IWidgetItem;
resetQuestionsRelatedQuestions(): IWidgetItem;
updateQuestionsRelatedQuestions(value: RelatedQuestions): IWidgetItem;
/** questions.related_questions.limit */
getQuestionsRelatedQuestionsLimit(): number;
setQuestionsRelatedQuestionsLimit(value: number): IWidgetItem;
resetQuestionsRelatedQuestionsLimit(): IWidgetItem;
/** questions.related_questions.offset */
getQuestionsRelatedQuestionsOffset(): number;
setQuestionsRelatedQuestionsOffset(value: number): IWidgetItem;
resetQuestionsRelatedQuestionsOffset(): IWidgetItem;