The DidYouMean controller is responsible for handling query corrections.

interface DidYouMean {
    state: DidYouMeanState;
    applyCorrection(): void;
    subscribe(listener: () => void): Unsubscribe;
}

Hierarchy (View Summary)

Methods

Properties

Methods

  • Executes a search using the suggested query correction.

    Typically, you should only call this method when state.hasQueryCorrection is true and state.wasAutomaticallyCorrected is false. When this is the case, you could call this method when the user clicks a link to search with the suggested query correction rather than with the query they originally submitted.

    Returns void

Properties

A scoped and simplified part of the headless state that is relevant to the DidYouMean controller.