1. Search request

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

NameTypeDescription
keyphrasestringPhrase used to search questions to be returned.
exact_answerExactAnswerObject describing the type of values to return.
related_questionsRelatedQuestionsObject describing how many and which questions to include in response.

RelatedQuestions interface

NameTypeDescription
limitnumberMaximum number of question and answer pairs.

Default: 5
offsetnumberNumber of question and answer pairs to omit before the beginning of the set returned.

ExactAnswer interface

NameTypeDescription
query_typesstringDescribes the type of values to generate.

question, statement, or keyword.
Note

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;
If you have suggestions for improving this article, let us know!