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

interface DidYouMeanState {
    hasQueryCorrection: boolean;
    originalQuery: string;
    queryCorrection: QueryCorrection;
    wasAutomaticallyCorrected: boolean;
    wasCorrectedTo: string;
}

Properties

hasQueryCorrection: boolean

Specifies if there is a query correction to apply.

originalQuery: string

The original query that was performed, without any automatic correction applied.

queryCorrection: QueryCorrection

The query correction that is currently applied by the "did you mean" module.

wasAutomaticallyCorrected: boolean

Specifies if the query was automatically corrected by Headless.

This happens when there is no result returned by the API for a particular misspelling.

wasCorrectedTo: string

The correction that was applied to the query. If no correction was applied, will default to an empty string.