1. JS SDK reference

Query

The Query object used for requests to the Search API, contains many properties that define and narrow results. Query hooking through the JS SDK sets some properties. Others have to be set by the developer.

Important

The JS SDK is built on top of the JS Data package. All request objects and methods available in the JS SDK are included in the JS Data package.

For documentation on the Search request object, refer to Search JS Data package.

setOffset

The method skip a certain number of results.

ArgumentTypeDescription
offsetintegerNumber of results to skip. Default 0.
filterfunctionAccepts any function in the following format: (v: any) => boolean.
query: (query:SearchResultsWidgetQuery) => query.getRequest().setOffset(10)

setSearchFilter

The method adds a search filter.

ArgumentTypeDescription
filterFilterObjectRequired. This object describes the filter.
query: (query:SearchResultsWidgetQuery) => query.getRequest().setOffset(10).setSearchFilter( new FilterEqual( 'category', 'bags') )
If you have suggestions for improving this article, let us know!