Skip to content

Interface: UseSearchState

The state useSearch returns.

clear: () => void

Clear the query and hits.

void


config: { basePath: string; defaultIndex?: string; indexes: object[]; pageSize: number; } | undefined

The resolved plugin config (indexes, default, page size).


error: string | null

The last error, if any.


hits: object[]

The latest hits, most relevant first.

fields: Record<string, unknown>

id: string

optional index?: string

score: number


loading: boolean

True while a request is in flight.


query: string

The current query text.


setQuery: (query) => void

Set the query (triggers a debounced search).

string

void


submit: () => void

Run the search immediately (bypassing the debounce).

void