From 760a4fc1de78edfb9eda6f372a51e8a729b5f961 Mon Sep 17 00:00:00 2001 From: Abdon Pijpelink Date: Tue, 15 Aug 2023 15:59:27 +0200 Subject: [PATCH] [DOCS] Update field descriptions for geogrid aggs (#2239) * Update field descriptions for geogrid aggs * Generate output --- output/schema/schema.json | 183 +++++++++++--------- output/schema/validation-errors.json | 1 + output/typescript/types.ts | 6 +- specification/_types/aggregations/bucket.ts | 9 +- 4 files changed, 115 insertions(+), 84 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index a0598355c1..9c19dbc168 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -39272,6 +39272,40 @@ ], "specLocation": "_spec_utils/BaseNode.ts#L25-L32" }, + { + "description": "A set of flags that can be represented as a single enum value or a set of values that are encoded\nas a pipe-separated string\n\nDepending on the target language, code generators can use this hint to generate language specific\nflags enum constructs and the corresponding (de-)serialization code.", + "generics": [ + { + "name": "T", + "namespace": "_spec_utils" + } + ], + "kind": "type_alias", + "name": { + "name": "PipeSeparatedFlags", + "namespace": "_spec_utils" + }, + "specLocation": "_spec_utils/PipeSeparatedFlags.ts#L20-L27", + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "T", + "namespace": "_spec_utils" + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ], + "kind": "union_of" + } + }, { "description": "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type.", "generics": [ @@ -47386,7 +47420,7 @@ "name": "AggregateOrder", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L975-L977", + "specLocation": "_types/aggregations/bucket.ts#L976-L978", "type": { "items": [ { @@ -48681,7 +48715,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L671-L684" + "specLocation": "_types/aggregations/bucket.ts#L672-L685" }, { "kind": "interface", @@ -49952,7 +49986,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1036-L1100" + "specLocation": "_types/aggregations/bucket.ts#L1037-L1101" }, { "codegenNames": [ @@ -49964,7 +49998,7 @@ "name": "CategorizeTextAnalyzer", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1102-L1105", + "specLocation": "_types/aggregations/bucket.ts#L1103-L1106", "type": { "items": [ { @@ -50017,7 +50051,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L734-L743" + "specLocation": "_types/aggregations/bucket.ts#L735-L744" }, { "attachedBehaviors": [ @@ -50632,7 +50666,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1107-L1111" + "specLocation": "_types/aggregations/bucket.ts#L1108-L1112" }, { "inherits": { @@ -51378,7 +51412,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L488-L497" + "specLocation": "_types/aggregations/bucket.ts#L489-L498" }, { "inherits": { @@ -52029,7 +52063,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1158-L1182" + "specLocation": "_types/aggregations/bucket.ts#L1159-L1183" }, { "attachedBehaviors": [ @@ -52159,7 +52193,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1144-L1156" + "specLocation": "_types/aggregations/bucket.ts#L1145-L1157" }, { "kind": "enum", @@ -52466,7 +52500,7 @@ } }, { - "description": "The name of the field.", + "description": "Field containing indexed `geo_point` or `geo_shape` values.\nIf the field contains an array, `geohash_grid` aggregates all array values.", "name": "field", "required": false, "type": { @@ -52516,7 +52550,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L405-L429" + "specLocation": "_types/aggregations/bucket.ts#L405-L430" }, { "attachedBehaviors": [ @@ -52804,7 +52838,7 @@ }, "properties": [ { - "description": "Field containing indexed `geo_point` or `geo_shape` values.", + "description": "Field containing indexed `geo_point` or `geo_shape` values.\nIf the field contains an array, `geotile_grid` aggregates all array values.", "name": "field", "required": false, "type": { @@ -52866,7 +52900,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L431-L456" + "specLocation": "_types/aggregations/bucket.ts#L432-L458" }, { "attachedBehaviors": [ @@ -52912,7 +52946,7 @@ }, "properties": [ { - "description": "Field containing indexed geo-point values. Must be explicitly\nmapped as a `geo_point` field. If the field contains an array\n`geohex_grid` aggregates all array values.", + "description": "Field containing indexed `geo_point` or `geo_shape` values.\nIf the field contains an array, `geohex_grid` aggregates all array values.", "name": "field", "required": true, "type": { @@ -52974,7 +53008,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L458-L484" + "specLocation": "_types/aggregations/bucket.ts#L460-L485" }, { "attachedBehaviors": [ @@ -53008,7 +53042,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L486-L486" + "specLocation": "_types/aggregations/bucket.ts#L487-L487" }, { "kind": "interface", @@ -53030,7 +53064,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L745-L750" + "specLocation": "_types/aggregations/bucket.ts#L746-L751" }, { "kind": "interface", @@ -53274,7 +53308,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L499-L545" + "specLocation": "_types/aggregations/bucket.ts#L500-L546" }, { "attachedBehaviors": [ @@ -53915,7 +53949,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1113-L1142" + "specLocation": "_types/aggregations/bucket.ts#L1114-L1143" }, { "attachedBehaviors": [ @@ -54046,7 +54080,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L547-L556" + "specLocation": "_types/aggregations/bucket.ts#L548-L557" }, { "kind": "interface", @@ -54116,7 +54150,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L558-L571" + "specLocation": "_types/aggregations/bucket.ts#L559-L572" }, { "attachedBehaviors": [ @@ -54933,7 +54967,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L573-L579" + "specLocation": "_types/aggregations/bucket.ts#L574-L580" }, { "kind": "enum", @@ -55283,7 +55317,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L623-L633" + "specLocation": "_types/aggregations/bucket.ts#L624-L634" }, { "inherits": { @@ -55428,7 +55462,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L581-L621" + "specLocation": "_types/aggregations/bucket.ts#L582-L622" }, { "attachedBehaviors": [ @@ -55517,7 +55551,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L752-L761" + "specLocation": "_types/aggregations/bucket.ts#L753-L762" }, { "attachedBehaviors": [ @@ -55564,7 +55598,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L635-L640" + "specLocation": "_types/aggregations/bucket.ts#L636-L641" }, { "inherits": { @@ -55674,7 +55708,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L642-L647" + "specLocation": "_types/aggregations/bucket.ts#L643-L648" }, { "kind": "interface", @@ -55683,7 +55717,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L763-L763" + "specLocation": "_types/aggregations/bucket.ts#L764-L764" }, { "inherits": { @@ -56096,7 +56130,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L649-L669" + "specLocation": "_types/aggregations/bucket.ts#L650-L670" }, { "attachedBehaviors": [ @@ -56272,7 +56306,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L686-L716" + "specLocation": "_types/aggregations/bucket.ts#L687-L717" }, { "inherits": { @@ -56417,7 +56451,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L718-L724" + "specLocation": "_types/aggregations/bucket.ts#L719-L725" }, { "attachedBehaviors": [ @@ -56465,7 +56499,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L726-L732" + "specLocation": "_types/aggregations/bucket.ts#L727-L733" }, { "kind": "enum", @@ -56508,7 +56542,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L765-L767" + "specLocation": "_types/aggregations/bucket.ts#L766-L768" }, { "inherits": { @@ -57014,7 +57048,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L769-L833" + "specLocation": "_types/aggregations/bucket.ts#L770-L834" }, { "attachedBehaviors": [ @@ -57291,7 +57325,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L835-L907" + "specLocation": "_types/aggregations/bucket.ts#L836-L908" }, { "inherits": { @@ -58685,7 +58719,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L909-L969" + "specLocation": "_types/aggregations/bucket.ts#L910-L970" }, { "kind": "enum", @@ -58703,7 +58737,7 @@ "name": "TermsAggregationCollectMode", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L979-L988" + "specLocation": "_types/aggregations/bucket.ts#L980-L989" }, { "kind": "enum", @@ -58725,7 +58759,7 @@ "name": "TermsAggregationExecutionHint", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L990-L995" + "specLocation": "_types/aggregations/bucket.ts#L991-L996" }, { "attachedBehaviors": [ @@ -58767,7 +58801,7 @@ "name": "TermsExclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1000-L1001", + "specLocation": "_types/aggregations/bucket.ts#L1001-L1002", "type": { "items": [ { @@ -58802,7 +58836,7 @@ "name": "TermsInclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L997-L998", + "specLocation": "_types/aggregations/bucket.ts#L998-L999", "type": { "items": [ { @@ -58865,7 +58899,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1003-L1012" + "specLocation": "_types/aggregations/bucket.ts#L1004-L1013" }, { "kind": "interface", @@ -59563,7 +59597,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1014-L1034" + "specLocation": "_types/aggregations/bucket.ts#L1015-L1035" }, { "attachedBehaviors": [ @@ -70999,7 +71033,7 @@ } ], "shortcutProperty": "query", - "specLocation": "_types/query_dsl/fulltext.ts#L33-L43" + "specLocation": "_types/query_dsl/fulltext.ts#L34-L44" }, { "inherits": { @@ -72912,7 +72946,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L49-L69" + "specLocation": "_types/query_dsl/fulltext.ts#L50-L70" }, { "kind": "interface", @@ -72949,7 +72983,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L71-L80" + "specLocation": "_types/query_dsl/fulltext.ts#L72-L81" }, { "kind": "interface", @@ -73031,7 +73065,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L82-L109", + "specLocation": "_types/query_dsl/fulltext.ts#L83-L110", "variants": { "kind": "container" } @@ -73152,7 +73186,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L111-L151", + "specLocation": "_types/query_dsl/fulltext.ts#L112-L152", "variants": { "kind": "container" } @@ -73242,7 +73276,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L153-L183" + "specLocation": "_types/query_dsl/fulltext.ts#L154-L184" }, { "kind": "interface", @@ -73328,7 +73362,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L185-L215" + "specLocation": "_types/query_dsl/fulltext.ts#L186-L216" }, { "kind": "interface", @@ -73376,7 +73410,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L217-L232" + "specLocation": "_types/query_dsl/fulltext.ts#L218-L233" }, { "inherits": { @@ -73466,7 +73500,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L234-L262", + "specLocation": "_types/query_dsl/fulltext.ts#L235-L263", "variants": { "kind": "container" } @@ -73515,7 +73549,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L264-L279" + "specLocation": "_types/query_dsl/fulltext.ts#L265-L280" }, { "codegenNames": [ @@ -73813,7 +73847,7 @@ } ], "shortcutProperty": "query", - "specLocation": "_types/query_dsl/fulltext.ts#L348-L402" + "specLocation": "_types/query_dsl/fulltext.ts#L349-L403" }, { "inherits": { @@ -73910,7 +73944,7 @@ } ], "shortcutProperty": "query", - "specLocation": "_types/query_dsl/fulltext.ts#L427-L453" + "specLocation": "_types/query_dsl/fulltext.ts#L428-L454" }, { "inherits": { @@ -73979,7 +74013,7 @@ } ], "shortcutProperty": "query", - "specLocation": "_types/query_dsl/fulltext.ts#L404-L425" + "specLocation": "_types/query_dsl/fulltext.ts#L405-L426" }, { "inherits": { @@ -74189,7 +74223,7 @@ } ], "shortcutProperty": "query", - "specLocation": "_types/query_dsl/fulltext.ts#L281-L346" + "specLocation": "_types/query_dsl/fulltext.ts#L282-L347" }, { "inherits": { @@ -74728,7 +74762,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L455-L538" + "specLocation": "_types/query_dsl/fulltext.ts#L456-L539" }, { "kind": "enum", @@ -76706,7 +76740,7 @@ } } ], - "specLocation": "_types/query_dsl/fulltext.ts#L579-L699" + "specLocation": "_types/query_dsl/fulltext.ts#L580-L700" }, { "kind": "interface", @@ -77381,14 +77415,14 @@ "description": "Enables the `+` AND operator.", "name": "AND" }, - { - "description": "Enables the `\\|` OR operator.", - "name": "OR" - }, { "description": "Enables the `-` NOT operator.", "name": "NOT" }, + { + "description": "Enables the `\\|` OR operator.", + "name": "OR" + }, { "description": "Enables the `*` prefix operator.", "name": "PREFIX" @@ -77433,10 +77467,6 @@ "specLocation": "_types/query_dsl/fulltext.ts#L708-L763" }, { - "codegenNames": [ - "single", - "multiple" - ], "description": "Query flags can be either a single flag or a combination of flags, e.g. `OR|AND|PREFIX`", "docId": "supported-flags", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/query-dsl-simple-query-string-query.html#supported-flags", @@ -77445,25 +77475,22 @@ "name": "SimpleQueryStringFlags", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/fulltext.ts#L701-L706", + "specLocation": "_types/query_dsl/fulltext.ts#L702-L706", "type": { - "items": [ + "generics": [ { "kind": "instance_of", "type": { "name": "SimpleQueryStringFlag", "namespace": "_types.query_dsl" } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } } ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "PipeSeparatedFlags", + "namespace": "_spec_utils" + } } }, { @@ -78506,7 +78533,7 @@ "name": "TextQueryType", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/fulltext.ts#L540-L566" + "specLocation": "_types/query_dsl/fulltext.ts#L541-L567" }, { "inherits": { @@ -78653,7 +78680,7 @@ "name": "ZeroTermsQuery", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/fulltext.ts#L568-L577" + "specLocation": "_types/query_dsl/fulltext.ts#L569-L578" }, { "generics": [ diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 6db70965e2..8deec10ece 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -65,6 +65,7 @@ "Request: query parameter 'pre_filter_shard_size' does not exist in the json spec", "Request: query parameter 'scroll' does not exist in the json spec", "Request: query parameter 'rest_total_hits_as_int' does not exist in the json spec", + "type_alias definition _spec_utils:PipeSeparatedFlags / union_of / instance_of - No type definition for '_spec_utils:T'", "interface definition _types:QueryVectorBuilder - Property text_embedding is a single-variant and must be required" ], "response": [] diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3e8ac02ef1..8646b2c108 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2016,6 +2016,8 @@ export interface SpecUtilsBaseNode { transport_address: TransportAddress } +export type SpecUtilsPipeSeparatedFlags = T | string + export type SpecUtilsStringified = T | string export type SpecUtilsVoid = void @@ -5943,9 +5945,9 @@ export interface QueryDslShapeQueryKeys extends QueryDslQueryBase { export type QueryDslShapeQuery = QueryDslShapeQueryKeys & { [property: string]: QueryDslShapeFieldQuery | boolean | float | string } -export type QueryDslSimpleQueryStringFlag = 'NONE' | 'AND' | 'OR' | 'NOT' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL' +export type QueryDslSimpleQueryStringFlag = 'NONE' | 'AND' | 'NOT' | 'OR' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL' -export type QueryDslSimpleQueryStringFlags = QueryDslSimpleQueryStringFlag | string +export type QueryDslSimpleQueryStringFlags = SpecUtilsPipeSeparatedFlags export interface QueryDslSimpleQueryStringQuery extends QueryDslQueryBase { analyzer?: string diff --git a/specification/_types/aggregations/bucket.ts b/specification/_types/aggregations/bucket.ts index 513d4c0285..f429759537 100644 --- a/specification/_types/aggregations/bucket.ts +++ b/specification/_types/aggregations/bucket.ts @@ -408,7 +408,8 @@ export class GeoHashGridAggregation extends BucketAggregationBase { */ bounds?: GeoBounds /** - * The name of the field. + * Field containing indexed `geo_point` or `geo_shape` values. + * If the field contains an array, `geohash_grid` aggregates all array values. */ field?: Field /** @@ -431,6 +432,7 @@ export class GeoHashGridAggregation extends BucketAggregationBase { export class GeoTileGridAggregation extends BucketAggregationBase { /** * Field containing indexed `geo_point` or `geo_shape` values. + * If the field contains an array, `geotile_grid` aggregates all array values. */ field?: Field /** @@ -457,9 +459,8 @@ export class GeoTileGridAggregation extends BucketAggregationBase { export class GeohexGridAggregation extends BucketAggregationBase { /** - * Field containing indexed geo-point values. Must be explicitly - * mapped as a `geo_point` field. If the field contains an array - * `geohex_grid` aggregates all array values. + * Field containing indexed `geo_point` or `geo_shape` values. + * If the field contains an array, `geohex_grid` aggregates all array values. */ field: Field /**