The Open API specification for Synapse is now available for download!

Download Open API Spec

Aggregation

org.sagebionetworks.repo.model.search.dsl.Aggregation

A single OpenSearch aggregation definition. Exactly one of the aggregation-kind properties below may be set; aggregations may additionally carry nested sub-aggregations. The filter and filters kinds wrap a Query; that query is validated identically to the top-level query and is scoped by it, so a filter aggregation never counts documents outside the top-level query.

Field Type Description
terms TermsAggregation A terms bucket aggregation — one bucket per distinct value of field.
histogram HistogramAggregation A histogram bucket aggregation over a numeric column. Must specify extended_bounds or hard_bounds so the bucket count is bounded.
date_histogram DateHistogramAggregation A date_histogram bucket aggregation over a date column. Must specify extended_bounds or hard_bounds so the bucket count is bounded.
range RangeAggregation A range bucket aggregation — one bucket per caller-defined numeric range.
date_range DateRangeAggregation A date_range bucket aggregation — one bucket per caller-defined date range.
missing MissingAggregation A missing bucket aggregation — a single bucket of documents that have no value for field.
min MinAggregation A min metric aggregation — the minimum value of a numeric column.
max MaxAggregation A max metric aggregation — the maximum value of a numeric column.
avg AvgAggregation An avg metric aggregation — the mean value of a numeric column.
sum SumAggregation A sum metric aggregation — the sum of a numeric column.
stats StatsAggregation A stats metric aggregation — count, min, max, avg, and sum of a numeric column in one pass.
extended_stats ExtendedStatsAggregation An extended_stats metric aggregation — stats plus variance, standard deviation, and standard-deviation bounds.
value_count ValueCountAggregation A value_count metric aggregation — the number of values extracted for a column.
cardinality CardinalityAggregation A cardinality metric aggregation — an approximate distinct-value count of a column.
filter Query

A single OpenSearch query DSL clause. Exactly one of the properties below may be set — the set property names the clause kind. See query vs. filter context and term-level vs. full-text queries.

The field-keyed leaf clauses (match, term, range, ...) are maps whose key is the column name and whose value is the per-field options object — only the long form is accepted (e.g. {"match":{"title":{"query":"x"}}}, not the {"match":{"title":"x"}} shorthand). The compound clauses (bool, dis_max, ...) nest further Query DSL clauses recursively.

filters FiltersAggregation A filters multi-bucket aggregation. Each entry of filters is a named bucket whose documents match its Query. The named (keyed) form is the supported contract; each query is validated identically to the top-level query and is scoped by it.
aggregations MAP<STRING,Aggregation> Optional. Nested sub-aggregations, keyed by caller-chosen name. Bucket aggregations compute these once per bucket.