SSR search engine

This is for:

Developer

Initialize

defineSearchEngine

Initializes a Search engine definition in SSR with given controllers definitions and search engine config.

Parameters

  • options: EngineDefinitionOptions<SearchEngineOptions, TControllers>

    The search engine definition

Returns SearchEngineDefinition

Methods

build

Builds an engine and its controllers from an engine definition.

Type: Build<TEngine, TEngineOptions, InferControllersMapFromDefinition<TControllers>, InferControllerPropsMapFromDefinitions<TControllers>>

fetchStaticState

Fetches the static state on the server side using your engine definition.

Type: FetchStaticState<TEngine, InferControllersMapFromDefinition<TControllers>, AnyAction, InferControllerStaticStateMapFromDefinitions<TControllers>, InferControllerPropsMapFromDefinitions<TControllers>>

hydrateStaticState

Fetches the hydrated state on the client side using your engine definition and the static state.

Type: HydrateStaticState<TEngine, InferControllersMapFromDefinition<TControllers>, AnyAction, InferControllerPropsMapFromDefinitions<TControllers>>

setNavigatorContextProvider

Sets the navigator context provider. This provider is essential for retrieving navigation-related data such as referrer, userAgent, location, and clientId, which are crucial for handling both server-side and client-side API requests effectively.

Note: The implementation specifics of the navigator context provider depend on the Node.js framework being utilized. It is the developer’s responsibility to appropriately define and implement the navigator context provider to ensure accurate navigation context is available throughout the application. If the user fails to provide a navigator context provider, a warning will be logged either on the server or the browser console.

Type: (navigatorContextProvider: NavigatorContextProvider) => void