Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions specification/_doc_ids/table.csv
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,9 @@ search-aggregations-bucket-significantterms-aggregation,https://www.elastic.co/d
search-aggregations-metrics-avg-aggregation,https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-avg-aggregation,,
search-aggregations-metrics-boxplot-aggregation,https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-boxplot-aggregation,,
search-aggregations-metrics-cardinality-aggregation,https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-cardinality-aggregation,,
search-aggregations-metrics-cartesian-bounds-aggregation,https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-cartesian-bounds-aggregation,,
search-aggregations-metrics-cartesian-centroid-aggregation,https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-cartesian-centroid-aggregation,,
search-aggregations-change-point-aggregation,https://www.elastic.co/docs/reference/aggregations/search-aggregations-change-point-aggregation,,
search-aggregations-metrics-extendedstats-aggregation,https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-extendedstats-aggregation,,
search-aggregations-pipeline-avg-bucket-aggregation,https://www.elastic.co/docs/reference/aggregations/search-aggregations-pipeline-avg-bucket-aggregation,,
search-aggregations-pipeline-bucket-path,https://www.elastic.co/docs/reference/aggregations/pipeline#buckets-path-syntax,,
Expand Down
11 changes: 5 additions & 6 deletions specification/_types/Geo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ export type GeoTile = string

/** A map hex cell (H3) reference */
export type GeoHexCell = string

export class LatLon {
lat: double
lon: double
}

/**
* A latitude/longitude as a 2 dimensional point. It can be represented in various ways:
* - as a `{lat, long}` object
Expand Down Expand Up @@ -128,6 +122,11 @@ export class LatLonGeoLocation {
lon: double
}

export class CartesianPoint {
x: double
y: double
}

export class GeoHashLocation {
geohash: GeoHash
}
Expand Down
80 changes: 79 additions & 1 deletion specification/_types/aggregations/Aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
import { CompositeAggregateKey } from '@_types/aggregations/bucket'
import { AggregateName, Field, FieldValue, Metadata } from '@_types/common'
import {
CartesianPoint,
GeoBounds,
GeoHash,
GeoHexCell,
GeoLine,
GeoLocation,
GeoTile
GeoTile,
TopLeftBottomRightGeoBounds
} from '@_types/Geo'
import { double, integer, long } from '@_types/Numeric'
import { DurationLarge, EpochTime, UnitMillis } from '@_types/Time'
Expand Down Expand Up @@ -59,11 +61,14 @@ export type Aggregate =
| SimpleValueAggregate
| DerivativeAggregate
| BucketMetricValueAggregate
| ChangePointAggregate
// Multi value
| StatsAggregate
| StatsBucketAggregate
| ExtendedStatsAggregate
| ExtendedStatsBucketAggregate
| CartesianBoundsAggregate
| CartesianCentroidAggregate
// Geo
| GeoBoundsAggregate
| GeoCentroidAggregate
Expand Down Expand Up @@ -322,6 +327,17 @@ export class ExtendedStatsAggregate extends StatsAggregate {
/** @variant name=extended_stats_bucket */
export class ExtendedStatsBucketAggregate extends ExtendedStatsAggregate {}

/** @variant name=cartesian_bounds */
export class CartesianBoundsAggregate extends AggregateBase {
bounds?: TopLeftBottomRightGeoBounds
}

/** @variant name=cartesian_centroid */
export class CartesianCentroidAggregate extends AggregateBase {
count: long
location?: CartesianPoint
}

//----- Geo

/**
Expand Down Expand Up @@ -369,6 +385,68 @@ export class MultiBucketBase
doc_count: long
}

/** @variant name=change_point */
export class ChangePointAggregate extends MultiBucketAggregateBase<ChangePointBucket> {
type: ChangeType
bucket?: ChangePointBucket
}

export class ChangePointBucket extends MultiBucketBase {
key: FieldValue
}

/**
* @variants typed_keys_quirk
*/
export type ChangeType =
| Dip
| DistributionChange
| Indeterminable
| NonStationary
| Spike
| Stationary
| StepChange
| TrendChange

export class AbstractChangePoint {
p_value: double
change_point: integer
}

/** @variant name=dip */
export class Dip extends AbstractChangePoint {}

/** @variant name=distribution_change */
export class DistributionChange extends AbstractChangePoint {}

/** @variant name=spike */
export class Spike extends AbstractChangePoint {}

/** @variant name=step_change */
export class StepChange extends AbstractChangePoint {}

/** @variant name=indeterminable */
export class Indeterminable {
reason: string
}

/** @variant name=non_stationary */
export class NonStationary {
p_value: double
r_value: double
trend: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@l-trotta l-trotta Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I noticed trend is a string in the server code, but in practice, there are only two values. Well, it's an implementation detail, so it's likely better not to rely on it. You're right.

}

/** @variant name=stationary */
export class Stationary {}

/** @variant name=trend_change */
export class TrendChange {
p_value: double
r_value: double
change_point: integer
}

/**
* @variant name=histogram
* @ext_doc_id search-aggregations-bucket-histogram-aggregation
Expand Down
23 changes: 23 additions & 0 deletions specification/_types/aggregations/AggregationContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ import {
AverageAggregation,
BoxplotAggregation,
CardinalityAggregation,
CartesianBoundsAggregation,
CartesianCentroidAggregation,
ExtendedStatsAggregation,
GeoBoundsAggregation,
GeoCentroidAggregation,
Expand Down Expand Up @@ -87,6 +89,7 @@ import {
BucketScriptAggregation,
BucketSelectorAggregation,
BucketSortAggregation,
ChangePointAggregation,
CumulativeCardinalityAggregation,
CumulativeSumAggregation,
DerivativeAggregation,
Expand Down Expand Up @@ -183,13 +186,32 @@ export class AggregationContainer {
* @ext_doc_id search-aggregations-metrics-cardinality-aggregation
*/
cardinality?: CardinalityAggregation
/**
* A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field.
* @ext_doc_id search-aggregations-metrics-cartesian-bounds-aggregation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you need an entry in specification/_doc_ids/table.csv for ext_doc_id to fully work. This also applies to change_point and cartesian_centroid.

*/
cartesian_bounds?: CartesianBoundsAggregation
/**
* A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields.
* @ext_doc_id search-aggregations-metrics-cartesian-centroid-aggregation
*/
cartesian_centroid?: CartesianCentroidAggregation
/**
* A multi-bucket aggregation that groups semi-structured text into buckets.
* @ext_doc_id search-aggregations-bucket-categorize-text-aggregation
* @availability stack stability=experimental
* @availability serverless stability=experimental
*/
categorize_text?: CategorizeTextAggregation
/**
* A sibling pipeline that detects, spikes, dips, and change points in a metric.
* Given a distribution of values provided by the sibling multi-bucket aggregation,
* this aggregation indicates the bucket of any spike or dip and/or the bucket at which
* the largest change in the distribution of values, if they are statistically significant.
* There must be at least 22 bucketed values. Fewer than 1,000 is preferred.
* @ext_doc_id search-aggregations-change-point-aggregation
*/
change_point?: ChangePointAggregation
/**
* A single bucket aggregation that selects child documents that have the specified type, as defined in a `join` field.
* @ext_doc_id search-aggregations-bucket-children-aggregation
Expand Down Expand Up @@ -245,6 +267,7 @@ export class AggregationContainer {
/**
* A bucket aggregation which finds frequent item sets, a form of association rules mining that identifies items that often occur together.
* @ext_doc_id search-aggregations-bucket-frequent-item-sets-aggregation
* @aliases frequent_items
*/
frequent_item_sets?: FrequentItemSetsAggregation
/**
Expand Down
4 changes: 4 additions & 0 deletions specification/_types/aggregations/metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export class ExtendedStatsAggregation extends FormatMetricAggregationBase {
sigma?: double
}

export class CartesianBoundsAggregation extends MetricAggregationBase {}

export class CartesianCentroidAggregation extends MetricAggregationBase {}

/**
* @ext_doc_id search-aggregations-metrics-geobounds-aggregation
*/
Expand Down
2 changes: 2 additions & 0 deletions specification/_types/aggregations/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ export class BucketSortAggregation extends Aggregation {
sort?: Sort
}

export class ChangePointAggregation extends PipelineAggregationBase {}

/**
* @ext_doc_id search-aggregations-pipeline-cumulative-cardinality-aggregation
*/
Expand Down
Loading