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.

Argument

Type

Description

offset

integer

Number of results to skip. Default 0.

filter

function

Accepts any function in the following format: (v: any) => boolean.

RequestResponse
query: (query:SearchResultsWidgetQuery) => query.getRequest().setOffset(10)

setSearchFilter

The method adds a search filter.

Argument

Type

Description

filter

FilterObject

Required. This object describes the filter.

RequestResponse
query: (query:SearchResultsWidgetQuery) => query.getRequest().setOffset(10).setSearchFilter( new FilterEqual( 'category', 'bags') )

Do you have some feedback for us?

If you have suggestions for improving this article,