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. See the JS SDK for detailed object shape.|
|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.|
|An object which maps a search string, |
|An array of active promotions on this result. See the JS SDK for detailed object shape.|
|0||Meta info about this query, feature score weight determines the weighting of featureScore vs neural and index scores.|
|0||An array of banners.|