InteractiveCitation
InteractiveCitation
This is for:
DeveloperThe InteractiveCitation
controller provides an interface for triggering desirable side effects, such as logging UA events to the Coveo Platform, when a user selects a generated answer citation.
Methods
beginDelayedSelect
Prepares to select the result after a certain delay, logging an analytics event if the result wasn’t selected before.
In a DOM context, it’s recommended to call this method on the touchstart
event.
cancelPendingSelect
Cancels the pending selection caused by beginDelayedSelect
.
In a DOM context, it’s recommended to call this method on the touchend
event.
select
Selects the result, logging an analytics event to the Coveo Platform if the result wasn’t selected before.
In a DOM context, it’s recommended to call this method on all of the following events:
-
contextmenu
*click
*mouseup
*mousedown
Initialize
buildInteractiveCitation
Creates an InteractiveCitation
controller instance.
Parameters
-
engine:
SearchEngine
The headless engine.
-
props:
InteractiveCitationProps
The configurable
InteractiveCitation
properties.
Returns InteractiveCitation
InteractiveCitationProps
The configurable InteractiveCitation
properties.
Properties
-
options:
InteractiveCitationOptions
The options for the
InteractiveCitation
controller.
InteractiveCitationOptions
The options for the InteractiveCitation
controller.
Properties
-
citation:
GeneratedAnswerCitation
The generated answer citation.
-
debounceWait?:
number
The number of seconds for which the debounced function should continue catching subsequent calls.
Default:
1000
-
selectionDelay?:
number
The amount of time to wait before selecting the result after calling
beginDelayedSelect
.Default:
1000
Related Types
GeneratedAnswerCitation
Properties
-
id:
string
-
permanentid:
string
-
source:
string
-
title:
string
-
uri:
string
-
clickUri?:
string
-
fields?:
Raw
-
text?:
string
Raw
Properties
-
[key: string]:
unknown
Custom keys that depend on the documents in the index.