Interface: UseSearchState
The state useSearch returns.
Properties
Section titled “Properties”clear: () =>
void
Clear the query and hits.
Returns
Section titled “Returns”void
config
Section titled “config”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
Section titled “fields”fields:
Record<string,unknown>
id:
string
index?
Section titled “index?”
optionalindex?:string
score:
number
loading
Section titled “loading”loading:
boolean
True while a request is in flight.
query:
string
The current query text.
setQuery
Section titled “setQuery”setQuery: (
query) =>void
Set the query (triggers a debounced search).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
submit
Section titled “submit”submit: () =>
void
Run the search immediately (bypassing the debounce).
Returns
Section titled “Returns”void