QuestionsAnswersWidgetItem
|
Type |
Class |
|
Extends |
|
|
Import path |
|
A widget item for a questions-answers widget.
Constructor
Parameters
|
Name |
Type |
Description |
|---|---|---|
|
|
|
Required. The entity associated with the widget. |
|
|
|
Required. The unique identifier of the widget. For questions and answers widgets, use the following ID: |
|
|
Options for retrieving AI-powered questions and answers. | |
|
|
|
Optional. A list of sourcesource IDs that identify the sources to include results from. Useful for filtering results by source, for example, when managing multiple sites. To find source IDs in Sitecore Search, on the menu bar, click Sources. If set, the response will contain results only from the specified sources. If unset, the response will return results from all sources. Example: Minimum length: 1. |
Properties
|
Name |
Type |
Description |
|---|---|---|
|
|
|
The text the site visitor enters in the search field to perform a search. Minimum length: 1. Maximum length: 100. |
|
|
Optional. Options to retrieve a single answer to the site visitor's query. Used in the questions-answers object of a widget item. | |
|
|
Optional. Options to retrieve AI-generated question-and-answer pairs relevant to the site visitor's query. Used in the questions-answers object of a widget item. |
Accessors
The following properties are available to get and set:
get keyphrase
Returns the keyphrase property of the QuestionsAnswersWidgetItem instance.
set keyphrase
Sets the keyphrase property of the QuestionsAnswersWidgetItem instance.
Parameters
|
Name |
Type |
Description |
|---|---|---|
|
|
|
The text the site visitor enters in the search field to perform a search. Minimum length: 1. Maximum length: 100. |
Errors
get exactAnswer
Returns the exactAnswer property of the QuestionsAnswersWidgetItem instance.
set exactAnswer
Sets the exactAnswer property of the QuestionsAnswersWidgetItem instance.
Parameters
|
Name |
Type |
Description |
|---|---|---|
|
|
Options to retrieve a single answer to the site visitor's query. Used in the questions-answers object of a widget item. |
get relatedQuestions
Returns the relatedQuestions property of the QuestionsAnswersWidgetItem instance.
set relatedQuestions
Sets the relatedQuestions property of the QuestionsAnswersWidgetItem instance.
Parameters
|
Name |
Type |
Description |
|---|---|---|
|
|
Options to retrieve AI-generated question-and-answer pairs relevant to the site visitor's query. Used in the questions-answers object of a widget item. |
Methods
_validateRelatedQuestions
Validates the provided relatedQuestions.
Signature
Parameters
|
Name |
Type |
Description |
|---|---|---|
|
|
Options to retrieve AI-generated question-and-answer pairs relevant to the site visitor's query. Used in the questions-answers object of a widget item. |
Return value
Returns void.
Errors
resetExactAnswer
Resets exactAnswer to undefined.
Signature
Return value
Returns void.
resetRelatedQuestions
Resets relatedQuestions to undefined.
Signature
Return value
Returns void.
toDTO
Maps the QuestionsAnswersWidgetItem instance to its DTO (data transfer object) format.
Signature
Return value
Returns the QuestionsAnswersWidgetItem instance in a standardized DTO format.