Skip to content

Commit 3ae610d

Browse files
authored
feat(search): avg metric aggregation
Adds `avg` as a permitted value on `aggregationOption.metricKind` and `searchAggregation.metricKind`. Distinct from sum/min/max because an average of two averages isn't mergeable: the backend has to carry (sum, count) internally per bucket and only collapse to the scalar `value` at the outermost merge. Wire shape stays symmetrical with sum/min/max: callers still just read `value` off the response; the (sum, count) bookkeeping is entirely service-side.
1 parent 7d21eba commit 3ae610d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

api/openapi-spec/v1.0.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6579,10 +6579,15 @@ components:
65796579
`searchAggregation` in the response carries a `value`
65806580
rather than `buckets`. Libregraph extension not present in
65816581
MS Graph.
6582+
6583+
`avg` is not a simple reducer (averages of averages are
6584+
not averages): the backend carries `(sum, count)`
6585+
internally and emits only `value` on the outermost merge.
65826586
enum:
65836587
- sum
65846588
- min
65856589
- max
6590+
- avg
65866591
bucketDefinition:
65876592
type: object
65886593
description: |
@@ -6769,6 +6774,7 @@ components:
67696774
- sum
67706775
- min
67716776
- max
6777+
- avg
67726778
searchBucket:
67736779
type: object
67746780
description: |

0 commit comments

Comments
 (0)