SmartSnippetQuestionsList (Insight Engine)
SmartSnippetQuestionsList (Insight Engine)
|
|
Note
This component was introduced in version |
The insight SmartSnippetQuestionsList controller allows to manage additional queries for which a SmartSnippet model can provide relevant excerpts.
Methods
beginDelayedSelectInlineLink
Prepares to select a link inside an answer after a certain delay, sending analytics if it was never selected before.
In a DOM context, we recommend calling this method on the touchstart event.
Parameters
-
identifier:
stringThe
questionAnswerIdof the smart snippet containing the link. -
link:
InlineLinkThe link to select.
beginDelayedSelectSource
Prepares to select the source after a certain delay, sending analytics if it hadn’t been selected before.
In a DOM context, we recommend calling this method on the touchstart event.
Parameters
-
identifier:
stringThe
questionAnswerIdof the smart snippet to collapse.
cancelPendingSelectInlineLink
Cancels the pending selection caused by beginDelayedSelectInlineLink.
In a DOM context, we recommend calling this method on the touchend event.
Parameters
-
identifier:
stringThe
questionAnswerIdof the smart snippet containing the link. -
link:
InlineLinkThe link to select.
cancelPendingSelectSource
Cancels the pending selection caused by beginDelayedSelect.
In a DOM context, we recommend calling this method on the touchend event.
Parameters
-
identifier:
stringThe
questionAnswerIdof the smart snippet to collapse.
selectInlineLink
Selects a link inside an answer, logging a UA event to the Coveo Platform if it was never selected before.
In a DOM context, we recommend calling this method on all of the following events: * contextmenu * click * mouseup * mousedown
Parameters
-
identifier:
stringThe
questionAnswerIdof the smart snippet containing the link. -
link:
InlineLinkThe link to select.
selectSource
Selects the source, logging a UA event to the Coveo Platform if the source hadn’t been selected before.
In a DOM context, we recommend calling this method on all of the following events: * contextmenu * click * mouseup * mousedown
Parameters
-
identifier:
stringThe
questionAnswerIdof the smart snippet to collapse.
collapse
Collapse the specified snippet suggestion.
Parameters
-
identifier:
stringThe
questionAnswerIdof the smart snippet to collapse.
expand
Expand the specified snippet suggestion.
Parameters
-
identifier:
stringThe
questionAnswerIdof the smart snippet to expand.
subscribe
Adds a callback that’s invoked on state change.
Parameters
-
listener:
() => voidA callback that’s invoked on state change.
Returns Unsubscribe: A function to remove the listener.
Attributes
state
The state of the SmartSnippetQuestionsList controller.
Properties
-
questions:
SmartSnippetRelatedQuestion[]The related questions for the current query
Initialize
buildSmartSnippetQuestionsList
Creates an insight SmartSnippetQuestionsList controller instance.
Parameters
-
engine:
InsightEngineThe headless engine.
-
props:
SmartSnippetQuestionsListPropsThe configurable
SmartSnippetQuestionsListproperties.
Returns SmartSnippetQuestionsList
SmartSnippetQuestionsListProps
The configurable SmartSnippetQuestionsList properties.
Properties
-
options?:
SmartSnippetQuestionsListOptionsThe options for the
SmartSnippetQuestionsListcontroller.
SmartSnippetQuestionsListOptions
The options for the SmartSnippetQuestionsList controller.
Properties
-
selectionDelay?:
numberThe amount of time in milliseconds to wait before selecting the source after calling
beginDelayedSelect.Default:
1000
Related types
HighlightKeyword
Properties
-
length:
numberThe length of the offset.
-
offset:
numberThe 0 based offset inside the string where the highlight should start.
InlineLink
Properties
-
linkText:
stringThe text of the inline link.
-
linkURL:
stringThe URL of the inline link.
QuestionAnswerDocumentIdentifier
Properties
-
contentIdKey:
stringThe content identifier key. Typically,
permanentidorurihash. -
contentIdValue:
stringThe content identifier value.
Raw
Properties
-
[key: string]:
unknownCustom keys that depend on the documents in the index.
Result
Properties
-
absentTerms:
string[]The basic query expression terms which this query result item does not match. Note: This property is populated by terms from the query pipeline-processed q value (not from the original q value).
-
clickUri:
stringThe hyperlinkable item URI. Notes: Use the clickUri value when you want to create hyperlinks to the item, rather than the uri or printableUri value.
-
excerpt:
stringThe contextual excerpt generated for the item (see the excerptLength query parameter).
-
excerptHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item excerpt string.
-
firstSentences:
stringThe first sentences retrieved from the item (see the retrieveFirstSentences query parameter).
-
firstSentencesHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item firstSentences string.
-
flags:
stringThe flags that are set on the item by the index. Distinct values are separated by semicolons.
-
hasHtmlVersion:
booleanWhether the index contains an HTML version of this item.
-
isRecommendation:
booleanWhether the item score was boosted as a Coveo ML recommendation.
-
isTopResult:
booleanWhether the item score was boosted by a featured result rule in the query pipeline.
-
isUserActionView:
booleanWhether the result item has been previously viewed by one of the users specified in the
canSeeUserProfileOfsection of the search token generated to perform the search request. -
percentScore:
numberThe item ranking score expressed as a percentage (see the sortCriteria and rankingFunctions query parameters).
-
printableUri:
stringThe human readable item URI. Note: Avoid using the printableUri value to create hyperlinks to the item. Use the clickUri value instead.
-
printableUriHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item printableUri string.
-
rankingInfo:
string | nullThe raw debug information generated by the index to detail how the item was ranked. This property is null unless the debug query parameter is set to true.
-
raw:
RawThe values of the fields which were retrieved for this item (see the fieldsToInclude and fieldsToExclude query parameters).
-
score:
numberThe total ranking score computed for the item (see the sortCriteria and rankingFunctions query parameters).
-
searchUid:
stringThe unique identifier of the search that returned this result.
-
summary:
nullThe item summary (see the summaryLength query parameter).
-
summaryHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item summary string.
-
title:
stringContains the title of the item.
-
titleHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item title string.
-
uniqueId:
stringThe unique item identifier. You should consider the uniqueId value as an opaque string.
-
uri:
stringThe item URI. Notes: Avoid using the uri value to create hyperlinks to the item. Use the clickUri value instead.
-
rankingModifier?:
stringIf applicable, represents the type of ranking modification that was applied to this result.
SmartSnippetRelatedQuestion
Properties
-
answer:
stringThe answer, or snippet, related to the question.
This can contain HTML markup, depending on the source of the answer.
-
documentId:
QuestionAnswerDocumentIdentifierThe index identifier for the document that provided the answer.
-
expanded:
booleanDetermines if the snippet is currently expanded.
-
question:
stringThe question related to the smart snippet.
-
questionAnswerId:
stringThe unique identifier for this question and answer.
-
source?:
ResultProvides the source of the smart snippet.
Unsubscribe
Call signatures
-
(): void;