InteractiveCitation

This is for:

Developer
In this article

The 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, sending analytics if it was never 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 a UA 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

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

GeneratedAnswerCitation

Properties

  • id: string

  • permanentid: 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.