The SSR search engine.

interface SearchEngine {
    dispatch: EngineDispatch<
        {
            debug: boolean;
            pipeline: string;
            search: SearchState;
            searchHub: string;
        } & Partial<SearchAppState> & {
            configuration: ConfigurationState;
            version: string;
        } & Partial<SearchParametersState>,
        SearchThunkExtraArguments,
    >;
    logger: Logger;
    navigatorContext: NavigatorContext;
    relay: Relay;
    state: {
        debug: boolean;
        pipeline: string;
        search: SearchState;
        searchHub: string;
    } & Partial<SearchAppState> & {
        configuration: ConfigurationState;
        version: string;
    } & Partial<SearchParametersState>;
    store: EnhancedStore<
        any,
        UnknownAction,
        Tuple<[StoreEnhancer<{ dispatch: {} }, {}>, StoreEnhancer<{}, {}>]>,
    >;
    addReducers(
        reducers: { [key: string]: Reducer<any, UnknownAction, any> },
    ): void;
    disableAnalytics(): void;
    enableAnalytics(): void;
    executeFirstSearch(analyticsEvent?: LegacySearchAction): void;
    executeFirstSearchAfterStandaloneSearchBoxRedirect(
        analytics: StandaloneSearchBoxAnalytics,
    ): void;
    subscribe(listener: () => void): Unsubscribe;
    waitForSearchCompletedAction(): Promise<SearchCompletedAction>;
}

Hierarchy

  • SearchEngine
    • SearchEngine

Methods

  • Adds the specified reducers to the store.

    Parameters

    • reducers: { [key: string]: Reducer<any, UnknownAction, any> }

      An object containing the reducers to attach to the engine.

    Returns void

  • Disable analytics tracking

    Returns void

  • Enable analytics tracking

    Returns void

  • Executes the first search.

    Parameters

    • OptionalanalyticsEvent: LegacySearchAction

      The analytics event to log in association with the first search. If unspecified, logInterfaceLoad will be used.

    Returns void

  • Executes the first search, and logs the analytics event that triggered a redirection from a standalone search box.

    Parameters

    Returns void

  • Adds a change listener. It will be called any time an action is dispatched, and some part of the state tree may potentially have changed. You may then access the new state.

    Parameters

    • listener: () => void

      A callback to be invoked on every dispatch.

    Returns Unsubscribe

    A function to remove this change listener.

  • Waits for the search to be completed and returns a promise that resolves to a SearchCompletedAction.

    Returns Promise<SearchCompletedAction>

Properties

dispatch: EngineDispatch<
    {
        debug: boolean;
        pipeline: string;
        search: SearchState;
        searchHub: string;
    } & Partial<SearchAppState> & {
        configuration: ConfigurationState;
        version: string;
    } & Partial<SearchParametersState>,
    SearchThunkExtraArguments,
>

Dispatches an action directly. This is the only way to trigger a state change. Each headless controller dispatches its own actions.

An action supported by the headless engine.

For convenience, the action object that was just dispatched.

logger: Logger

The logger instance used by headless.

navigatorContext: NavigatorContext

The navigator context (referer, location, UserAgent)

relay: Relay

The Relay instance used by Headless.

state: {
    debug: boolean;
    pipeline: string;
    search: SearchState;
    searchHub: string;
} & Partial<SearchAppState> & {
    configuration: ConfigurationState;
    version: string;
} & Partial<SearchParametersState>

The complete headless state tree.

store: EnhancedStore<
    any,
    UnknownAction,
    Tuple<[StoreEnhancer<{ dispatch: {} }, {}>, StoreEnhancer<{}, {}>]>,
>

The redux store.