Skip to main content

A Query allows us to provide a nested structure of expressions (as Operators) that contain criteria that we can use with the entries.search() method in a Delivery API client. The returned object allows us to add additional refinements to the search before the request for content is made, such as specifying the pageIndex, the ordering of results, or which fields to return.

Call signature

TypeScript
new Query(...whereExpressions: Operators[]): Query

Parameters

NameTypeDescription
whereExpressionsOperators[]An array of search expressions constructed as Operators

Returns

An instance of Query we can set specific properties and use with entries.search()

Properties

NameTypeDescription
orderBystring | string[] | OrderBySort search results by one or more content fields
pageIndexnumberThe index of subsequent pages of search results (required if > 0)
pageSizenumberThe size of each page of search results
fieldLinkDepths{ string: number }Object containing field paths to resolve linked entries for and the link depth to resolve the field to
fieldsstring [ ... ]A list of entry fields that will be retrieved (if the returned entries contain them)
whereWhereExpressionRead or refine query expressions

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request