@coveo/headless
    Preparing search index...

    Interface DidYouMean

    The DidYouMean controller is responsible for handling query corrections.

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

    Hierarchy (View Summary)

    Index
    • Executes a search using the suggested query correction.

      Typically, you 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

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