@coveo/headless
    Preparing search index...

    Interface DidYouMean

    The DidYouMean controller is responsible for handling query corrections.

    Example: did-you-mean.fn.tsx

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

    Hierarchy (View Summary)

    Index

    Methods

    • Update which query correction system to use

      legacy: Query correction is powered by the legacy index system. This system relies on an algorithm using solely the index content to compute the suggested terms. next: Query correction is powered by a machine learning system, requiring a valid query suggestion model configured in your Coveo environment to function properly. This system relies on machine learning algorithms to compute the suggested terms.

      Parameters

      • queryCorrectionMode: QueryCorrectionMode

        the query correction mode to use

      Returns void

    Properties

    The state of the DidYouMean controller.