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
new Query(...whereExpressions: Operators[]): Query
Parameters
Name | Type | Description |
---|---|---|
whereExpressions | Operators[] | An array of search expressions constructed as Operators |
Returns
An instance of Query
we can set specific properties and use with entries.search()
Properties
Name | Type | Description |
---|---|---|
where | WhereExpression | Read or refine query expressions |
pageSize | number | The size of each page of search results |
pageIndex | number | The index of subsequent pages of search results (required if > 0) |
orderBy | string | string[] | OrderBy | Sort search results by one or more content fields |
fields | string [ ... ] | 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 |
aggregations | QueryAggregations | Object defining aggregations of field data to return along with the page of search results |