Skip to content

Commit

Permalink
Add note about AggregateOrder parsing lazyness (#1777) (#1778)
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez authored Jun 30, 2022
1 parent ff80fef commit cda51c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 7 additions & 7 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions specification/_types/aggregations/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ export class TermsAggregation extends BucketAggregationBase {
size?: integer
}

// Note: ES is very lazy when parsing this data type: it accepts any number of properties in the objects below,
// but will only keep the *last* property in JSON document order and ignore others.
// This means that something like `"order": { "downloads": "desc", "_key": "asc" }` will actually be interpreted
// as `"order": [ { "_key": "asc" } ]`
export type AggregateOrder =
| SingleKeyDictionary<Field, SortOrder>
| SingleKeyDictionary<Field, SortOrder>[]
Expand Down

0 comments on commit cda51c1

Please sign in to comment.