useSearch provides a way to perform a search using the current context or a custom one-off search.
Returns results for the current query. By default it will use the Variables and Pipeline from the context:
As in the above example, it's possible to perform one off searches using the
useSearch hook. This means we can build a page that performs multiple searches, for example within different categories.
Note: each category search request must use it's own pipeline.
Computers & Tablets
TV & Home Theater
useSearch returns an object containing the following properties:
|An array of results that met the query.|
|The engine latency.|
|The total count of results.|
|The search method, call without param to resend the search request with the current query.|
|Is a search request being processed.|
|The error encountered while searching.|