Obj.where(attribute, operator, value, boost)

Returns an ObjSearch with the given initial subquery based on the specified arguments.

Note that attribute and value can also be arrays for searching several attributes or values. For detailed information see ObjSearch.

Params

  • attribute (String or Array<String>) - See ObjSearch for details.
  • operator (String) - See Search operators for details.
  • value (String, Date, Time, Number, Obj, or Array<String>) - See ObjSearch#and for details.
  • boost (optional) (Object) - See ObjSearch#and for details.

Returns

ObjSearch

Remarks

[New in 1.24.0]If the strictSearchOperators option is set to true in Scrivito.configure, this method does not accept the contains and containsPrefix operators for full-text searches. Use the whereFullTextOf method instead.

Examples

Perform a full-text search and iterate the matching CMS objects.

Print the top results of a full-text search. Matches in permalinks and headline attributes are boosted (i.e. ranked higher):

Find downloads (PDF files) containing the word “white” or “paper”, or both words.