From 9e4f9d45ef731216dd22781bc66baa1bb2a98446 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Mon, 3 Mar 2025 12:27:56 +0100 Subject: [PATCH] geo_grid --- output/openapi/elasticsearch-openapi.json | 32 ++++ .../elasticsearch-serverless-openapi.json | 32 ++++ output/schema/schema-serverless.json | 171 +++++++++++++----- output/schema/schema.json | 107 +++++++++-- output/typescript/types.ts | 7 + .../_types/query_dsl/abstractions.ts | 6 + specification/_types/query_dsl/geo.ts | 12 +- 7 files changed, 302 insertions(+), 65 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 862c9f976a..5a1b4f37a3 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -45911,6 +45911,15 @@ "geo_distance": { "$ref": "#/components/schemas/_types.query_dsl:GeoDistanceQuery" }, + "geo_grid": { + "description": "Matches `geo_point` and `geo_shape` values that intersect a grid cell from a GeoGrid aggregation.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/_types.query_dsl:GeoGridQuery" + }, + "minProperties": 1, + "maxProperties": 1 + }, "geo_polygon": { "$ref": "#/components/schemas/_types.query_dsl:GeoPolygonQuery" }, @@ -47026,6 +47035,29 @@ "plane" ] }, + "_types.query_dsl:GeoGridQuery": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.query_dsl:QueryBase" + }, + { + "type": "object", + "properties": { + "geogrid": { + "$ref": "#/components/schemas/_types:GeoTile" + }, + "geohash": { + "$ref": "#/components/schemas/_types:GeoHash" + }, + "geohex": { + "$ref": "#/components/schemas/_types:GeoHexCell" + } + }, + "minProperties": 1, + "maxProperties": 1 + } + ] + }, "_types.query_dsl:GeoPolygonQuery": { "allOf": [ { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 7c804d0902..a4e5eba0e7 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -26114,6 +26114,15 @@ "geo_distance": { "$ref": "#/components/schemas/_types.query_dsl:GeoDistanceQuery" }, + "geo_grid": { + "description": "Matches `geo_point` and `geo_shape` values that intersect a grid cell from a GeoGrid aggregation.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/_types.query_dsl:GeoGridQuery" + }, + "minProperties": 1, + "maxProperties": 1 + }, "geo_polygon": { "$ref": "#/components/schemas/_types.query_dsl:GeoPolygonQuery" }, @@ -27229,6 +27238,29 @@ "plane" ] }, + "_types.query_dsl:GeoGridQuery": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.query_dsl:QueryBase" + }, + { + "type": "object", + "properties": { + "geogrid": { + "$ref": "#/components/schemas/_types:GeoTile" + }, + "geohash": { + "$ref": "#/components/schemas/_types:GeoHash" + }, + "geohex": { + "$ref": "#/components/schemas/_types:GeoHexCell" + } + }, + "minProperties": 1, + "maxProperties": 1 + } + ] + }, "_types.query_dsl:GeoPolygonQuery": { "allOf": [ { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index e57c7813c6..be15f82dd4 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -49204,6 +49204,29 @@ } } }, + { + "description": "Matches `geo_point` and `geo_shape` values that intersect a grid cell from a GeoGrid aggregation.", + "name": "geo_grid", + "required": false, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + "kind": "dictionary_of", + "singleKey": true, + "value": { + "kind": "instance_of", + "type": { + "name": "GeoGridQuery", + "namespace": "_types.query_dsl" + } + } + } + }, { "deprecation": { "description": "Use geo-shape instead.", @@ -50060,7 +50083,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L102-L428", + "specLocation": "_types/query_dsl/abstractions.ts#L103-L434", "variants": { "kind": "container", "nonExhaustive": true @@ -50239,7 +50262,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L453-L464" + "specLocation": "_types/query_dsl/abstractions.ts#L459-L470" }, { "kind": "type_alias", @@ -50585,7 +50608,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L466-L500" + "specLocation": "_types/query_dsl/abstractions.ts#L472-L506" }, { "kind": "enum", @@ -50601,7 +50624,7 @@ "name": "CombinedFieldsOperator", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/abstractions.ts#L513-L516" + "specLocation": "_types/query_dsl/abstractions.ts#L519-L522" }, { "kind": "enum", @@ -50619,7 +50642,7 @@ "name": "CombinedFieldsZeroTerms", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/abstractions.ts#L518-L527" + "specLocation": "_types/query_dsl/abstractions.ts#L524-L533" }, { "extDocId": "query-dsl-constant-score-query", @@ -52117,7 +52140,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L32-L54" + "specLocation": "_types/query_dsl/geo.ts#L35-L57" }, { "codegenNames": [ @@ -52441,7 +52464,7 @@ "name": "GeoExecution", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/geo.ts#L56-L59" + "specLocation": "_types/query_dsl/geo.ts#L59-L62" }, { "kind": "enum", @@ -52462,7 +52485,7 @@ "name": "GeoValidationMethod", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/geo.ts#L163-L173" + "specLocation": "_types/query_dsl/geo.ts#L173-L183" }, { "attachedBehaviors": [ @@ -52564,7 +52587,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L61-L93" + "specLocation": "_types/query_dsl/geo.ts#L64-L96" }, { "kind": "type_alias", @@ -52599,6 +52622,90 @@ }, "specLocation": "_types/Geo.ts#L42-L51" }, + { + "inherits": { + "type": { + "name": "QueryBase", + "namespace": "_types.query_dsl" + } + }, + "kind": "interface", + "name": { + "name": "GeoGridQuery", + "namespace": "_types.query_dsl" + }, + "properties": [ + { + "name": "geogrid", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoTile", + "namespace": "_types" + } + } + }, + { + "name": "geohash", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoHash", + "namespace": "_types" + } + } + }, + { + "name": "geohex", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoHexCell", + "namespace": "_types" + } + } + } + ], + "specLocation": "_types/query_dsl/geo.ts#L98-L103", + "variants": { + "kind": "container" + } + }, + { + "description": "A map tile reference, represented as `{zoom}/{x}/{y}`", + "kind": "type_alias", + "name": { + "name": "GeoTile", + "namespace": "_types" + }, + "specLocation": "_types/Geo.ts#L93-L94", + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "A map hex cell (H3) reference", + "kind": "type_alias", + "name": { + "name": "GeoHexCell", + "namespace": "_types" + }, + "specLocation": "_types/Geo.ts#L96-L97", + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, { "attachedBehaviors": [ "AdditionalProperty" @@ -52673,7 +52780,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L99-L111" + "specLocation": "_types/query_dsl/geo.ts#L109-L121" }, { "kind": "interface", @@ -52697,7 +52804,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L95-L97" + "specLocation": "_types/query_dsl/geo.ts#L105-L107" }, { "attachedBehaviors": [ @@ -52759,7 +52866,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L131-L147" + "specLocation": "_types/query_dsl/geo.ts#L141-L157" }, { "kind": "interface", @@ -52805,7 +52912,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L118-L129" + "specLocation": "_types/query_dsl/geo.ts#L128-L139" }, { "description": "A GeoJson shape, that can also use Elasticsearch's `envelope` extension.", @@ -52875,7 +52982,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L430-L447" + "specLocation": "_types/query_dsl/abstractions.ts#L436-L453" }, { "kind": "enum", @@ -53350,7 +53457,7 @@ } ], "shortcutProperty": "field", - "specLocation": "_types/query_dsl/abstractions.ts#L529-L543" + "specLocation": "_types/query_dsl/abstractions.ts#L535-L549" }, { "inherits": { @@ -60442,7 +60549,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L502-L511" + "specLocation": "_types/query_dsl/abstractions.ts#L508-L517" }, { "inherits": { @@ -78505,38 +78612,6 @@ } } }, - { - "description": "A map hex cell (H3) reference", - "kind": "type_alias", - "name": { - "name": "GeoHexCell", - "namespace": "_types" - }, - "specLocation": "_types/Geo.ts#L96-L97", - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "A map tile reference, represented as `{zoom}/{x}/{y}`", - "kind": "type_alias", - "name": { - "name": "GeoTile", - "namespace": "_types" - }, - "specLocation": "_types/Geo.ts#L93-L94", - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, { "kind": "type_alias", "name": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 3d259c6bbd..335dc93d37 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -81271,7 +81271,7 @@ "name": "CombinedFieldsOperator", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/abstractions.ts#L513-L516" + "specLocation": "_types/query_dsl/abstractions.ts#L519-L522" }, { "kind": "interface", @@ -81367,7 +81367,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L466-L500" + "specLocation": "_types/query_dsl/abstractions.ts#L472-L506" }, { "kind": "enum", @@ -81385,7 +81385,7 @@ "name": "CombinedFieldsZeroTerms", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/abstractions.ts#L518-L527" + "specLocation": "_types/query_dsl/abstractions.ts#L524-L533" }, { "kind": "interface", @@ -82049,7 +82049,7 @@ } ], "shortcutProperty": "field", - "specLocation": "_types/query_dsl/abstractions.ts#L529-L543" + "specLocation": "_types/query_dsl/abstractions.ts#L535-L549" }, { "kind": "interface", @@ -82107,7 +82107,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L430-L447" + "specLocation": "_types/query_dsl/abstractions.ts#L436-L453" }, { "kind": "enum", @@ -82698,7 +82698,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L32-L54" + "specLocation": "_types/query_dsl/geo.ts#L35-L57" }, { "kind": "interface", @@ -82865,7 +82865,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L61-L93" + "specLocation": "_types/query_dsl/geo.ts#L64-L96" }, { "kind": "enum", @@ -82881,7 +82881,59 @@ "name": "GeoExecution", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/geo.ts#L56-L59" + "specLocation": "_types/query_dsl/geo.ts#L59-L62" + }, + { + "kind": "interface", + "inherits": { + "type": { + "name": "QueryBase", + "namespace": "_types.query_dsl" + } + }, + "name": { + "name": "GeoGridQuery", + "namespace": "_types.query_dsl" + }, + "properties": [ + { + "name": "geogrid", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoTile", + "namespace": "_types" + } + } + }, + { + "name": "geohash", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoHash", + "namespace": "_types" + } + } + }, + { + "name": "geohex", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoHexCell", + "namespace": "_types" + } + } + } + ], + "specLocation": "_types/query_dsl/geo.ts#L98-L103", + "variants": { + "kind": "container" + } }, { "kind": "interface", @@ -82905,7 +82957,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L95-L97" + "specLocation": "_types/query_dsl/geo.ts#L105-L107" }, { "kind": "interface", @@ -82981,7 +83033,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L99-L111" + "specLocation": "_types/query_dsl/geo.ts#L109-L121" }, { "kind": "interface", @@ -83027,7 +83079,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L118-L129" + "specLocation": "_types/query_dsl/geo.ts#L128-L139" }, { "kind": "interface", @@ -83089,7 +83141,7 @@ } } ], - "specLocation": "_types/query_dsl/geo.ts#L131-L147" + "specLocation": "_types/query_dsl/geo.ts#L141-L157" }, { "kind": "enum", @@ -83110,7 +83162,7 @@ "name": "GeoValidationMethod", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/geo.ts#L163-L173" + "specLocation": "_types/query_dsl/geo.ts#L173-L183" }, { "kind": "interface", @@ -85764,7 +85816,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L453-L464" + "specLocation": "_types/query_dsl/abstractions.ts#L459-L470" }, { "kind": "interface", @@ -85973,6 +86025,29 @@ } } }, + { + "description": "Matches `geo_point` and `geo_shape` values that intersect a grid cell from a GeoGrid aggregation.", + "name": "geo_grid", + "required": false, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + "singleKey": true, + "value": { + "kind": "instance_of", + "type": { + "name": "GeoGridQuery", + "namespace": "_types.query_dsl" + } + } + } + }, { "deprecation": { "description": "Use geo-shape instead.", @@ -86829,7 +86904,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L102-L428", + "specLocation": "_types/query_dsl/abstractions.ts#L103-L434", "variants": { "kind": "container", "nonExhaustive": true @@ -89714,7 +89789,7 @@ } } ], - "specLocation": "_types/query_dsl/abstractions.ts#L502-L511" + "specLocation": "_types/query_dsl/abstractions.ts#L508-L517" }, { "kind": "enum", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 5cad42a45a..3cd29dd052 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -6100,6 +6100,12 @@ export type QueryDslGeoDistanceQuery = QueryDslGeoDistanceQueryKeys export type QueryDslGeoExecution = 'memory' | 'indexed' +export interface QueryDslGeoGridQuery extends QueryDslQueryBase { + geogrid?: GeoTile + geohash?: GeoHash + geohex?: GeoHexCell +} + export interface QueryDslGeoPolygonPoints { points: GeoLocation[] } @@ -6395,6 +6401,7 @@ export interface QueryDslQueryContainer { fuzzy?: Partial> geo_bounding_box?: QueryDslGeoBoundingBoxQuery geo_distance?: QueryDslGeoDistanceQuery + geo_grid?: Partial> geo_polygon?: QueryDslGeoPolygonQuery geo_shape?: QueryDslGeoShapeQuery has_child?: QueryDslHasChildQuery diff --git a/specification/_types/query_dsl/abstractions.ts b/specification/_types/query_dsl/abstractions.ts index 9c7c3767dc..1a560f79a2 100644 --- a/specification/_types/query_dsl/abstractions.ts +++ b/specification/_types/query_dsl/abstractions.ts @@ -48,6 +48,7 @@ import { import { GeoBoundingBoxQuery, GeoDistanceQuery, + GeoGridQuery, GeoPolygonQuery, GeoShapeQuery } from './geo' @@ -167,6 +168,11 @@ export class QueryContainer { * @ext_doc_id query-dsl-geo-distance-query */ geo_distance?: GeoDistanceQuery + + /** + * Matches `geo_point` and `geo_shape` values that intersect a grid cell from a GeoGrid aggregation. + */ + geo_grid?: SingleKeyDictionary /** * @deprecated 7.12.0 Use geo-shape instead. */ diff --git a/specification/_types/query_dsl/geo.ts b/specification/_types/query_dsl/geo.ts index e78d9d5fdf..d73e6327e3 100644 --- a/specification/_types/query_dsl/geo.ts +++ b/specification/_types/query_dsl/geo.ts @@ -23,9 +23,12 @@ import { Distance, GeoBounds, GeoDistanceType, + GeoHash, + GeoHexCell, GeoLocation, GeoShape, - GeoShapeRelation + GeoShapeRelation, + GeoTile } from '@_types/Geo' import { FieldLookup, QueryBase } from './abstractions' @@ -92,6 +95,13 @@ export class GeoDistanceQuery ignore_unmapped?: boolean } +/** @variants container */ +export class GeoGridQuery extends QueryBase { + geogrid?: GeoTile + geohash?: GeoHash + geohex?: GeoHexCell +} + export class GeoPolygonPoints { points: GeoLocation[] }