Package-level declarations

Types

Link copied to clipboard

Builds an aggregate query: its filter, the collections it expands into elements, its groups (terms, histogram, dateHistogram, datePart), its metrics, sort by group and metric aliases, limit and having. Inside an expanded element, a group or metric field is relative to the innermost element unless its scope is AggregationGroupScope.ROOT.

Link copied to clipboard

Builds a count query: the matches of filter, counted up to limit (the budget's limit by default).

Link copied to clipboard

Builds a cursor query: size records after cursor, the nextCursor of the previous page (none at first).

Link copied to clipboard

The expression context of AggregationQueryDsl.derived: constant returns a DerivedExpression.Constant rather than the AggregationExpression.Constant of AggregationQueryDsl.constant, so the two scopes do not share a receiver type.

Link copied to clipboard
class FilterDsl

Builds a FilterExpression: each call adds one node, and the block's nodes are combined with AND (one node alone is the filter itself). A field is named by its path, as a string ("state.status") or as a QueryField, such as a generated <State>Properties constant; every field operator takes either.

Link copied to clipboard

The expression context of AggregationQueryDsl.having: its String.eq takes a Double and yields a HavingExpression rather than the FilterExpression of FilterDsl, so the two scopes do not share a receiver type. Each name is a metric alias.

Link copied to clipboard

Builds a list query: up to limit records, the entry's default list size when not set.

Link copied to clipboard
abstract class NestedFieldDsl

A DSL whose fields may be named under a common path: after nested("state"), "name" is state.name. A path already under it is kept as it is.

Link copied to clipboard

Builds a paged query: the page of pagination, with its total counted as total says.

Link copied to clipboard

Builds a Pagination: the page index, from 1, and its size; page 1 of 10 by default.

Link copied to clipboard

Builds a Projection: the fields to return (include) or to leave out (exclude); with neither, every field.

Link copied to clipboard
abstract class QueryableDsl<Q>

The parts every query kind but count and aggregate has: its filter (every record by default), projection and sort.

Link copied to clipboard
annotation class QueryDslMarker

Marks the receivers of the query DSL, so a block reaches only its own receiver's functions: inside filter { } of a listQuery { }, limit(...) is not in scope.

Link copied to clipboard

Builds a single query: the first record by sort, if any matches.

Link copied to clipboard

Builds a sort: each call adds one field, in order.

Functions

Link copied to clipboard

An aggregate query: grouped metrics of the matches. Experimental, as the aggregation protocol is.

Link copied to clipboard

A count query: the number of matches, bounded.

Link copied to clipboard

A cursor query: the matches after a cursor, with the cursor of the next page.

Link copied to clipboard
Link copied to clipboard

A list query: up to its limit of matches.

Link copied to clipboard

A paged query: one page of the matches, with their total.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A single query: the first match by its sort.

Link copied to clipboard
fun sort(block: SortDsl.() -> Unit): List<Sort>