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

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