useSearch
A React hook that instantiates your Search Client.
import { useSearch } from 'basehub/react-search'
Arguments
Key | Type | Description |
---|---|---|
|
| Required. The search key from the block where you want to do search. The client will have access to all indexed fields under the corresponding block (and its instances in a case of a component). |
|
| Required. An array with the field keys you want to search by. |
|
| An object that accepts a |
BaseHub Search uses TypeSense on the background. You can check out all the search options on their documentation. Keep in mind that they’re all on camelCase in the useSearch
hook. E.g: filter_by
is listed as filterBy
.
Examples
Documentation: Step by step
Also you can check out our search implementation for this Documentation template on GitHub