New in 1.34.0 (BETA)

filters()

Returns the filters resulting from the DataScope.

The application integrating the Scrivito SDK with an external data provider can use this parameter for filtering.

Returns

Object – An object representing the filters of the IndexParam. Its keys are the attribute names, and the values are objects representing filter specifications. If no parameters are specified, an empty object ({}) is returned.

New in 1.41.0

Filter specifications

Filter specifications are objects with three keys:

  • [New in 1.43.0]operator (String) – Name of the operator. The supported operators are equals, notEquals, isGreaterThan, isGreaterThanOrEquals, isLessThan and isLessThanOrEquals.
  • opCode (String) – An operator code derived from the operator.
  • value (String) – Attribute value.

The opCode is only present in filter specifications returned by IndexParams#filters, but must not be included in the filter params for DataScope#transform.

New in ​1.43.0

"And" filter specifications

Allows you to apply multiple filter operators to the same attribute:

New in 1.43.0

​Operator codes

A short form of the operator. We recommend using this for communicating filter specifications to the backend service in order to keep the URLs short.

  • eq – if operator is equals
  • neq – if operator is notEquals
  • gt – if operator is isGreaterThan
  • gte – if operator is isGreaterThanOrEquals
  • lt – if operator is isLessThan
  • lte – if operator is isLessThanOrEquals