From d9490a07a2fa7cc8dcdf5febf1ff245fa691644c Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 2 Apr 2024 10:40:05 +0200 Subject: [PATCH 01/18] put lifecycle req name optional (456) --- specification/ilm/put_lifecycle/PutLifecycleRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ilm/put_lifecycle/PutLifecycleRequest.ts b/specification/ilm/put_lifecycle/PutLifecycleRequest.ts index 3247d4921c..c36a3bebb8 100644 --- a/specification/ilm/put_lifecycle/PutLifecycleRequest.ts +++ b/specification/ilm/put_lifecycle/PutLifecycleRequest.ts @@ -35,7 +35,7 @@ export interface Request extends RequestBase { * Identifier for the policy. * @codegen_name name */ - policy: Name + policy?: Name } query_parameters: { /** From 0fa1f0b719ba78750801cb5dc5851b991b5b0271 Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 2 Apr 2024 10:48:29 +0200 Subject: [PATCH 02/18] added script to witdh histogram (457) --- specification/_types/aggregations/bucket.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/specification/_types/aggregations/bucket.ts b/specification/_types/aggregations/bucket.ts index 5183060fa4..d736c23e34 100644 --- a/specification/_types/aggregations/bucket.ts +++ b/specification/_types/aggregations/bucket.ts @@ -30,7 +30,7 @@ import { GeoLocation, GeoBounds } from '@_types/Geo' -import { integer, float, long, double } from '@_types/Numeric' +import { integer, long, double } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' import { Script } from '@_types/Scripting' import { @@ -40,11 +40,9 @@ import { TimeZone, DurationLarge } from '@_types/Time' -import { Buckets, TermsAggregateBase } from './Aggregate' +import { Buckets } from './Aggregate' import { Aggregation } from './Aggregation' import { Missing, MissingOrder } from './AggregationContainer' -import { OverloadOf } from '@spec_utils/behaviors' -import { Term } from '@global/termvectors/types' import { ValueType } from '@_types/aggregations/metric' /** @@ -1032,6 +1030,7 @@ export class VariableWidthHistogramAggregation { * Defaults to `min(10 * shard_size, 50000)`. */ initial_buffer?: integer + script?: Script } /** From cebe5f007f01138ac073bc3f6bfd3d01a0e4aa25 Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 2 Apr 2024 10:52:00 +0200 Subject: [PATCH 03/18] typo fix dynamic type (spec issue 1558) (460) --- specification/_types/mapping/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index 0cdbe2cee6..ddd44429a0 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -284,7 +284,7 @@ export class WildcardProperty extends DocValuesPropertyBase { } export class DynamicProperty extends DocValuesPropertyBase { - type: '{dynamic_property}' + type: '{dynamic_type}' enabled?: boolean null_value?: FieldValue From 779e3fb1ff83b2859a66a08a935702c7b87a06df Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 2 Apr 2024 10:56:01 +0200 Subject: [PATCH 04/18] primary term optional index req (472) --- specification/_types/Base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/_types/Base.ts b/specification/_types/Base.ts index 8f5c13e4b4..3b4c3b9dca 100644 --- a/specification/_types/Base.ts +++ b/specification/_types/Base.ts @@ -36,7 +36,7 @@ export class RequestBase implements CommonQueryParameters {} export class WriteResponseBase { _id: Id _index: IndexName - _primary_term: long + _primary_term?: long result: Result _seq_no: SequenceNumber _shards: ShardStatistics From d27b593e3d1dcfb5ebd96a9cd9aee41bfaea6c2c Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 2 Apr 2024 12:25:04 +0200 Subject: [PATCH 05/18] added escaped_tags property to htmlstrip (528) --- specification/_global/msearch/types.ts | 1 - specification/_types/analysis/char_filters.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/_global/msearch/types.ts b/specification/_global/msearch/types.ts index 46934beba4..57495ade82 100644 --- a/specification/_global/msearch/types.ts +++ b/specification/_global/msearch/types.ts @@ -41,7 +41,6 @@ import { Rescore } from '@global/search/_types/rescoring' import { SourceConfig } from '@global/search/_types/SourceFilter' import { RuntimeFields } from '@_types/mapping/RuntimeFields' import { ScriptField } from '@_types/Scripting' -import { SlicedScroll } from '@_types/SlicedScroll' import { KnnQuery } from '@_types/Knn' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' diff --git a/specification/_types/analysis/char_filters.ts b/specification/_types/analysis/char_filters.ts index c0d17cc833..e139070596 100644 --- a/specification/_types/analysis/char_filters.ts +++ b/specification/_types/analysis/char_filters.ts @@ -42,6 +42,7 @@ export type CharFilterDefinition = export class HtmlStripCharFilter extends CharFilterBase { type: 'html_strip' + escaped_tags?: string[] } export class MappingCharFilter extends CharFilterBase { From 557c514692fd00b928e1c6b0bb34008bd3398dd8 Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 2 Apr 2024 12:26:28 +0200 Subject: [PATCH 06/18] regen --- .../elasticsearch-serverless-openapi.json | 12 +- output/schema/schema.json | 171 ++++++++++-------- output/schema/validation-errors.json | 1 + output/typescript/types.ts | 8 +- 4 files changed, 114 insertions(+), 78 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 7247ccb79f..04a49f0db2 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -39585,6 +39585,9 @@ "initial_buffer": { "description": "Specifies the number of individual documents that will be stored in memory on a shard before the initial bucketing algorithm is run.\nDefaults to `min(10 * shard_size, 50000)`.", "type": "number" + }, + "script": { + "$ref": "#/components/schemas/_types:Script" } } }, @@ -42450,6 +42453,12 @@ "enum": [ "html_strip" ] + }, + "escaped_tags": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ @@ -45805,7 +45814,7 @@ "type": { "type": "string", "enum": [ - "{dynamic_property}" + "{dynamic_type}" ] }, "enabled": { @@ -47964,7 +47973,6 @@ "required": [ "_id", "_index", - "_primary_term", "result", "_seq_no", "_shards", diff --git a/output/schema/schema.json b/output/schema/schema.json index af363f86ae..81bcbae101 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -26712,7 +26712,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L214-L217" + "specLocation": "_global/msearch/types.ts#L213-L216" }, { "generics": [ @@ -26762,7 +26762,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L204-L207" + "specLocation": "_global/msearch/types.ts#L203-L206" }, { "kind": "interface", @@ -27235,7 +27235,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L71-L202" + "specLocation": "_global/msearch/types.ts#L70-L201" }, { "description": "Contains parameters used to limit or change the subsequent search body request.", @@ -27367,7 +27367,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L53-L68" + "specLocation": "_global/msearch/types.ts#L52-L67" }, { "attachedBehaviors": [ @@ -27578,7 +27578,7 @@ "name": "RequestItem", "namespace": "_global.msearch" }, - "specLocation": "_global/msearch/types.ts#L48-L51", + "specLocation": "_global/msearch/types.ts#L47-L50", "type": { "items": [ { @@ -27648,7 +27648,7 @@ "name": "ResponseItem", "namespace": "_global.msearch" }, - "specLocation": "_global/msearch/types.ts#L209-L212", + "specLocation": "_global/msearch/types.ts#L208-L211", "type": { "items": [ { @@ -48051,7 +48051,7 @@ }, { "name": "_primary_term", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -48300,7 +48300,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L57-L63" + "specLocation": "_types/aggregations/bucket.ts#L55-L61" }, { "attachedBehaviors": [ @@ -48859,7 +48859,7 @@ "name": "AggregateOrder", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L976-L978", + "specLocation": "_types/aggregations/bucket.ts#L974-L976", "type": { "items": [ { @@ -50155,7 +50155,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L672-L685" + "specLocation": "_types/aggregations/bucket.ts#L670-L683" }, { "kind": "interface", @@ -50377,7 +50377,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L65-L100" + "specLocation": "_types/aggregations/bucket.ts#L63-L98" }, { "inherits": { @@ -50638,7 +50638,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L50-L55" + "specLocation": "_types/aggregations/bucket.ts#L48-L53" }, { "description": "A sibling pipeline aggregation which executes a correlation function on the configured sibling multi-bucket aggregation.", @@ -51172,7 +51172,7 @@ "name": "CalendarInterval", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L249-L266" + "specLocation": "_types/aggregations/bucket.ts#L247-L264" }, { "inherits": { @@ -51426,7 +51426,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1037-L1101" + "specLocation": "_types/aggregations/bucket.ts#L1036-L1100" }, { "codegenNames": [ @@ -51438,7 +51438,7 @@ "name": "CategorizeTextAnalyzer", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1103-L1106", + "specLocation": "_types/aggregations/bucket.ts#L1102-L1105", "type": { "items": [ { @@ -51491,7 +51491,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L735-L744" + "specLocation": "_types/aggregations/bucket.ts#L733-L742" }, { "attachedBehaviors": [ @@ -51538,7 +51538,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L111-L116" + "specLocation": "_types/aggregations/bucket.ts#L109-L114" }, { "inherits": { @@ -51583,7 +51583,7 @@ "name": "CompositeAggregateKey", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L118-L118", + "specLocation": "_types/aggregations/bucket.ts#L116-L116", "type": { "key": { "kind": "instance_of", @@ -51668,7 +51668,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L120-L136" + "specLocation": "_types/aggregations/bucket.ts#L118-L134" }, { "kind": "interface", @@ -51746,7 +51746,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L157-L166" + "specLocation": "_types/aggregations/bucket.ts#L155-L164" }, { "kind": "interface", @@ -51804,7 +51804,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L138-L155" + "specLocation": "_types/aggregations/bucket.ts#L136-L153" }, { "attachedBehaviors": [ @@ -51907,7 +51907,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L174-L182" + "specLocation": "_types/aggregations/bucket.ts#L172-L180" }, { "inherits": { @@ -51945,7 +51945,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L184-L187" + "specLocation": "_types/aggregations/bucket.ts#L182-L185" }, { "inherits": { @@ -51972,7 +51972,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L170-L172" + "specLocation": "_types/aggregations/bucket.ts#L168-L170" }, { "inherits": { @@ -51987,7 +51987,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L168-L168" + "specLocation": "_types/aggregations/bucket.ts#L166-L166" }, { "description": "Result of the `cumulative_cardinality` aggregation", @@ -52106,7 +52106,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1108-L1112" + "specLocation": "_types/aggregations/bucket.ts#L1107-L1111" }, { "inherits": { @@ -52353,7 +52353,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L189-L247" + "specLocation": "_types/aggregations/bucket.ts#L187-L245" }, { "attachedBehaviors": [ @@ -52511,7 +52511,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L268-L294" + "specLocation": "_types/aggregations/bucket.ts#L266-L292" }, { "kind": "interface", @@ -52557,7 +52557,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L305-L318" + "specLocation": "_types/aggregations/bucket.ts#L303-L316" }, { "inherits": { @@ -52689,7 +52689,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L320-L341" + "specLocation": "_types/aggregations/bucket.ts#L318-L339" }, { "description": "Result of a `terms` aggregation when the field is some kind of decimal number like a float, double, or distance.", @@ -52852,7 +52852,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L489-L498" + "specLocation": "_types/aggregations/bucket.ts#L487-L496" }, { "inherits": { @@ -53192,7 +53192,7 @@ "name": "FieldDateMath", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L296-L303", + "specLocation": "_types/aggregations/bucket.ts#L294-L301", "type": { "items": [ { @@ -53330,7 +53330,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L358-L378" + "specLocation": "_types/aggregations/bucket.ts#L356-L376" }, { "attachedBehaviors": [ @@ -53503,7 +53503,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1159-L1183" + "specLocation": "_types/aggregations/bucket.ts#L1158-L1182" }, { "attachedBehaviors": [ @@ -53603,7 +53603,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1145-L1157" + "specLocation": "_types/aggregations/bucket.ts#L1144-L1156" }, { "kind": "enum", @@ -53857,7 +53857,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L380-L403" + "specLocation": "_types/aggregations/bucket.ts#L378-L401" }, { "inherits": { @@ -53960,7 +53960,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L405-L430" + "specLocation": "_types/aggregations/bucket.ts#L403-L428" }, { "attachedBehaviors": [ @@ -54310,7 +54310,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L432-L458" + "specLocation": "_types/aggregations/bucket.ts#L430-L456" }, { "attachedBehaviors": [ @@ -54418,7 +54418,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L460-L485" + "specLocation": "_types/aggregations/bucket.ts#L458-L483" }, { "attachedBehaviors": [ @@ -54452,7 +54452,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L487-L487" + "specLocation": "_types/aggregations/bucket.ts#L485-L485" }, { "kind": "interface", @@ -54474,7 +54474,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L746-L751" + "specLocation": "_types/aggregations/bucket.ts#L744-L749" }, { "kind": "interface", @@ -54718,7 +54718,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L500-L546" + "specLocation": "_types/aggregations/bucket.ts#L498-L544" }, { "attachedBehaviors": [ @@ -55359,7 +55359,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1114-L1143" + "specLocation": "_types/aggregations/bucket.ts#L1113-L1142" }, { "attachedBehaviors": [ @@ -55490,7 +55490,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L548-L557" + "specLocation": "_types/aggregations/bucket.ts#L546-L555" }, { "kind": "interface", @@ -55560,7 +55560,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L559-L572" + "specLocation": "_types/aggregations/bucket.ts#L557-L570" }, { "attachedBehaviors": [ @@ -56278,7 +56278,7 @@ "name": "MinimumInterval", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L102-L109" + "specLocation": "_types/aggregations/bucket.ts#L100-L107" }, { "kind": "type_alias", @@ -56377,7 +56377,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L574-L580" + "specLocation": "_types/aggregations/bucket.ts#L572-L578" }, { "kind": "enum", @@ -56727,7 +56727,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L624-L634" + "specLocation": "_types/aggregations/bucket.ts#L622-L632" }, { "inherits": { @@ -56872,7 +56872,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L582-L622" + "specLocation": "_types/aggregations/bucket.ts#L580-L620" }, { "attachedBehaviors": [ @@ -56961,7 +56961,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L753-L762" + "specLocation": "_types/aggregations/bucket.ts#L751-L760" }, { "attachedBehaviors": [ @@ -57008,7 +57008,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L636-L641" + "specLocation": "_types/aggregations/bucket.ts#L634-L639" }, { "inherits": { @@ -57118,7 +57118,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L643-L648" + "specLocation": "_types/aggregations/bucket.ts#L641-L646" }, { "kind": "interface", @@ -57127,7 +57127,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L764-L764" + "specLocation": "_types/aggregations/bucket.ts#L762-L762" }, { "inherits": { @@ -57540,7 +57540,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L650-L670" + "specLocation": "_types/aggregations/bucket.ts#L648-L668" }, { "attachedBehaviors": [ @@ -57716,7 +57716,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L687-L717" + "specLocation": "_types/aggregations/bucket.ts#L685-L715" }, { "inherits": { @@ -57861,7 +57861,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L719-L725" + "specLocation": "_types/aggregations/bucket.ts#L717-L723" }, { "attachedBehaviors": [ @@ -57909,7 +57909,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L727-L733" + "specLocation": "_types/aggregations/bucket.ts#L725-L731" }, { "kind": "enum", @@ -57931,7 +57931,7 @@ "name": "SamplerAggregationExecutionHint", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L343-L356" + "specLocation": "_types/aggregations/bucket.ts#L341-L354" }, { "kind": "interface", @@ -57952,7 +57952,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L766-L768" + "specLocation": "_types/aggregations/bucket.ts#L764-L766" }, { "inherits": { @@ -58458,7 +58458,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L770-L834" + "specLocation": "_types/aggregations/bucket.ts#L768-L832" }, { "attachedBehaviors": [ @@ -58720,7 +58720,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L836-L908" + "specLocation": "_types/aggregations/bucket.ts#L834-L906" }, { "inherits": { @@ -60114,7 +60114,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L910-L970" + "specLocation": "_types/aggregations/bucket.ts#L908-L968" }, { "kind": "enum", @@ -60132,7 +60132,7 @@ "name": "TermsAggregationCollectMode", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L980-L989" + "specLocation": "_types/aggregations/bucket.ts#L978-L987" }, { "kind": "enum", @@ -60154,7 +60154,7 @@ "name": "TermsAggregationExecutionHint", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L991-L996" + "specLocation": "_types/aggregations/bucket.ts#L989-L994" }, { "attachedBehaviors": [ @@ -60196,7 +60196,7 @@ "name": "TermsExclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L1001-L1002", + "specLocation": "_types/aggregations/bucket.ts#L999-L1000", "type": { "items": [ { @@ -60231,7 +60231,7 @@ "name": "TermsInclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L998-L999", + "specLocation": "_types/aggregations/bucket.ts#L996-L997", "type": { "items": [ { @@ -60294,7 +60294,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L1004-L1013" + "specLocation": "_types/aggregations/bucket.ts#L1002-L1011" }, { "kind": "interface", @@ -60990,9 +60990,20 @@ "namespace": "_types" } } + }, + { + "name": "script", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Script", + "namespace": "_types" + } + } } ], - "specLocation": "_types/aggregations/bucket.ts#L1015-L1035" + "specLocation": "_types/aggregations/bucket.ts#L1013-L1034" }, { "attachedBehaviors": [ @@ -62361,9 +62372,23 @@ "kind": "literal_value", "value": "html_strip" } + }, + { + "name": "escaped_tags", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } } ], - "specLocation": "_types/analysis/char_filters.ts#L43-L45" + "specLocation": "_types/analysis/char_filters.ts#L43-L46" }, { "inherits": { @@ -64012,7 +64037,7 @@ } } ], - "specLocation": "_types/analysis/char_filters.ts#L47-L51" + "specLocation": "_types/analysis/char_filters.ts#L48-L52" }, { "inherits": { @@ -64727,7 +64752,7 @@ } } ], - "specLocation": "_types/analysis/char_filters.ts#L53-L58" + "specLocation": "_types/analysis/char_filters.ts#L54-L59" }, { "inherits": { @@ -68196,7 +68221,7 @@ "required": true, "type": { "kind": "literal_value", - "value": "{dynamic_property}" + "value": "{dynamic_type}" } }, { @@ -110562,7 +110587,7 @@ "codegenName": "name", "description": "Identifier for the policy.", "name": "policy", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 952ad87ffd..38579e45cd 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -687,6 +687,7 @@ }, "ilm.put_lifecycle": { "request": [ + "Request: path parameter 'policy' is required in the json spec", "Request: query parameter 'master_timeout' does not exist in the json spec", "Request: query parameter 'timeout' does not exist in the json spec" ], diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 65f4a4c74b..386e1e5890 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2807,7 +2807,7 @@ export interface WktGeoBounds { export interface WriteResponseBase { _id: Id _index: IndexName - _primary_term: long + _primary_term?: long result: Result _seq_no: SequenceNumber _shards: ShardStatistics @@ -4195,6 +4195,7 @@ export interface AggregationsVariableWidthHistogramAggregation { buckets?: integer shard_size?: integer initial_buffer?: integer + script?: Script } export interface AggregationsVariableWidthHistogramBucketKeys extends AggregationsMultiBucketBase { @@ -4344,6 +4345,7 @@ export interface AnalysisFingerprintTokenFilter extends AnalysisTokenFilterBase export interface AnalysisHtmlStripCharFilter extends AnalysisCharFilterBase { type: 'html_strip' + escaped_tags?: string[] } export interface AnalysisHunspellTokenFilter extends AnalysisTokenFilterBase { @@ -4970,7 +4972,7 @@ export interface MappingDoubleRangeProperty extends MappingRangePropertyBase { export type MappingDynamicMapping = boolean | 'strict' | 'runtime' | 'true' | 'false' export interface MappingDynamicProperty extends MappingDocValuesPropertyBase { - type: '{dynamic_property}' + type: '{dynamic_type}' enabled?: boolean null_value?: FieldValue boost?: double @@ -9646,7 +9648,7 @@ export interface IlmMoveToStepStepKey { } export interface IlmPutLifecycleRequest extends RequestBase { - name: Name + name?: Name master_timeout?: Duration timeout?: Duration body?: { From f40c4b7582f3a6203e0e79cf3df997206bbec0ba Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 2 Apr 2024 13:03:35 +0200 Subject: [PATCH 07/18] remove per_field_analyzer from mlt query (533) --- .../elasticsearch-serverless-openapi.json | 8 +----- output/schema/schema.json | 28 ++----------------- output/typescript/types.ts | 1 - specification/_types/query_dsl/specialized.ts | 8 +++--- 4 files changed, 8 insertions(+), 37 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 04a49f0db2..eb3726130a 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -35249,13 +35249,6 @@ "description": "The minimum word length below which the terms are ignored.", "type": "number" }, - "per_field_analyzer": { - "description": "Overrides the default analyzer.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, "routing": { "$ref": "#/components/schemas/_types:Routing" }, @@ -35323,6 +35316,7 @@ "$ref": "#/components/schemas/_types:IndexName" }, "per_field_analyzer": { + "description": "Overrides the default analyzer.", "type": "object", "additionalProperties": { "type": "string" diff --git a/output/schema/schema.json b/output/schema/schema.json index 81bcbae101..ffc3585bdf 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -75201,6 +75201,7 @@ } }, { + "description": "Overrides the default analyzer.", "name": "per_field_analyzer", "required": false, "type": { @@ -75257,7 +75258,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L165-L184" + "specLocation": "_types/query_dsl/specialized.ts#L162-L184" }, { "inherits": { @@ -75986,29 +75987,6 @@ } } }, - { - "description": "Overrides the default analyzer.", - "name": "per_field_analyzer", - "required": false, - "type": { - "key": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - }, { "name": "routing", "required": false, @@ -76083,7 +76061,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L78-L163" + "specLocation": "_types/query_dsl/specialized.ts#L78-L160" }, { "inherits": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 386e1e5890..39157fe06b 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5730,7 +5730,6 @@ export interface QueryDslMoreLikeThisQuery extends QueryDslQueryBase { minimum_should_match?: MinimumShouldMatch min_term_freq?: integer min_word_length?: integer - per_field_analyzer?: Record routing?: Routing stop_words?: AnalysisStopWords unlike?: QueryDslLike | QueryDslLike[] diff --git a/specification/_types/query_dsl/specialized.ts b/specification/_types/query_dsl/specialized.ts index 72753097bc..f4e99b5277 100644 --- a/specification/_types/query_dsl/specialized.ts +++ b/specification/_types/query_dsl/specialized.ts @@ -143,10 +143,7 @@ export class MoreLikeThisQuery extends QueryBase { * @server_default 0 */ min_word_length?: integer - /** - * Overrides the default analyzer. - */ - per_field_analyzer?: Dictionary + routing?: Routing /** * An array of stop words. @@ -176,6 +173,9 @@ export class LikeDocument { * Index of a document. */ _index?: IndexName + /** + * Overrides the default analyzer. + */ per_field_analyzer?: Dictionary routing?: Routing version?: VersionNumber From a935a9c6272ced1872eeafdcd30050d99a38ca32 Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 2 Apr 2024 13:06:23 +0200 Subject: [PATCH 08/18] min and max optional in extendedBounds (555) --- specification/_types/aggregations/bucket.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/_types/aggregations/bucket.ts b/specification/_types/aggregations/bucket.ts index d736c23e34..061abe95f8 100644 --- a/specification/_types/aggregations/bucket.ts +++ b/specification/_types/aggregations/bucket.ts @@ -488,11 +488,11 @@ export class ExtendedBounds { /** * Maximum value for the bound. */ - max: T + max?: T /** * Minimum value for the bound. */ - min: T + min?: T } export class HistogramAggregation extends BucketAggregationBase { From de46d9e35edbc1ceef3b830db6f66e0c1a038457 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Tue, 2 Apr 2024 16:53:39 +0200 Subject: [PATCH 09/18] allow_auto_create added to putIndexTemplate req (571) --- .../elasticsearch-serverless-openapi.json | 16 ++++++--------- output/schema/schema.json | 20 +++++++++++++++---- output/typescript/types.ts | 5 +++-- .../IndicesPutIndexTemplateRequest.ts | 6 ++++++ 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index eb3726130a..ffabac7ec0 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -26119,6 +26119,10 @@ "schema": { "type": "object", "properties": { + "allow_auto_create": { + "description": "This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.", + "type": "boolean" + }, "index_patterns": { "$ref": "#/components/schemas/_types:Indices" }, @@ -37445,11 +37449,7 @@ "min": { "$ref": "#/components/schemas/_types.aggregations:FieldDateMath" } - }, - "required": [ - "max", - "min" - ] + } }, "_types.aggregations:FieldDateMath": { "description": "A date range limit, represented either as a DateMath expression or a number expressed\naccording to the target field's precision.", @@ -38080,11 +38080,7 @@ "description": "Minimum value for the bound.", "type": "number" } - }, - "required": [ - "max", - "min" - ] + } }, "_types.aggregations:IpRangeAggregation": { "allOf": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index ffc3585bdf..2b6a39e80b 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -52830,7 +52830,7 @@ { "description": "Maximum value for the bound.", "name": "max", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -52842,7 +52842,7 @@ { "description": "Minimum value for the bound.", "name": "min", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -121280,7 +121280,7 @@ } } ], - "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L97-L119" + "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L103-L125" }, { "attachedBehaviors": [ @@ -121289,6 +121289,18 @@ "body": { "kind": "properties", "properties": [ + { + "description": "This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.", + "name": "allow_auto_create", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, { "description": "Name of the index template to create.", "name": "index_patterns", @@ -121421,7 +121433,7 @@ } } ], - "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L36-L95" + "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L36-L101" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 39157fe06b..d4f4f7d70a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -3247,8 +3247,8 @@ export interface AggregationsEwmaMovingAverageAggregation extends AggregationsMo } export interface AggregationsExtendedBounds { - max: T - min: T + max?: T + min?: T } export interface AggregationsExtendedStatsAggregate extends AggregationsStatsAggregate { @@ -10791,6 +10791,7 @@ export interface IndicesPutIndexTemplateRequest extends RequestBase { name: Name create?: boolean body?: { + allow_auto_create?: boolean index_patterns?: Indices composed_of?: Name[] template?: IndicesPutIndexTemplateIndexTemplateMapping diff --git a/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts b/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts index b3a6a533c4..c78330b7e6 100644 --- a/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts +++ b/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts @@ -46,6 +46,12 @@ export interface Request extends RequestBase { name: Name } body: { + /** + * This setting overrides the value of the `action.auto_create_index` cluster setting. + * If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. + * If set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. + */ + allow_auto_create?: boolean /** * Name of the index template to create. */ From a74d4ce1db0ee5c2a805176571ae4fef40cdd9d9 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Tue, 2 Apr 2024 17:06:47 +0200 Subject: [PATCH 10/18] added composite to runtime fields (551) --- output/openapi/elasticsearch-serverless-openapi.json | 1 + output/schema/schema.json | 5 ++++- output/typescript/types.ts | 2 +- specification/_types/mapping/RuntimeFields.ts | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index ffabac7ec0..4834926204 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -39729,6 +39729,7 @@ "type": "string", "enum": [ "boolean", + "composite", "date", "double", "geo_point", diff --git a/output/schema/schema.json b/output/schema/schema.json index 2b6a39e80b..86165db461 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -70934,6 +70934,9 @@ { "name": "boolean" }, + { + "name": "composite" + }, { "name": "date" }, @@ -70960,7 +70963,7 @@ "name": "RuntimeFieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/RuntimeFields.ts#L56-L65" + "specLocation": "_types/mapping/RuntimeFields.ts#L56-L66" }, { "kind": "type_alias", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index d4f4f7d70a..a6df3465cf 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5231,7 +5231,7 @@ export interface MappingRuntimeFieldFetchFields { format?: string } -export type MappingRuntimeFieldType = 'boolean' | 'date' | 'double' | 'geo_point' | 'ip' | 'keyword' | 'long' | 'lookup' +export type MappingRuntimeFieldType = 'boolean' | 'composite' | 'date' | 'double' | 'geo_point' | 'ip' | 'keyword' | 'long' | 'lookup' export type MappingRuntimeFields = Record diff --git a/specification/_types/mapping/RuntimeFields.ts b/specification/_types/mapping/RuntimeFields.ts index de3a0e9e33..b5ad85f52d 100644 --- a/specification/_types/mapping/RuntimeFields.ts +++ b/specification/_types/mapping/RuntimeFields.ts @@ -55,6 +55,7 @@ export class RuntimeFieldFetchFields { export enum RuntimeFieldType { boolean, + composite, date, double, geo_point, From e4c656bb6bd6155ce0325bf8602fb96004dfac6e Mon Sep 17 00:00:00 2001 From: Laura Date: Wed, 3 Apr 2024 13:58:08 +0200 Subject: [PATCH 11/18] removed fields from aggregation (466,766), response for sim index (572) --- .../elasticsearch-serverless-openapi.json | 26 +++--- output/schema/schema.json | 83 ++++++++++--------- output/typescript/types.ts | 20 +++-- .../_types/aggregations/Aggregation.ts | 7 +- .../aggregations/AggregationContainer.ts | 1 - .../IndicesSimulateIndexTemplateResponse.ts | 10 ++- specification/ml/_types/Datafeed.ts | 5 +- 7 files changed, 82 insertions(+), 70 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 4834926204..2c2247a8c0 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -7169,7 +7169,21 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "properties": { + "overlapping": { + "type": "array", + "items": { + "$ref": "#/components/schemas/indices.simulate_template:Overlapping" + } + }, + "template": { + "$ref": "#/components/schemas/indices.simulate_template:Template" + } + }, + "required": [ + "template" + ] } } } @@ -36684,15 +36698,7 @@ ] }, "_types.aggregations:Aggregation": { - "type": "object", - "properties": { - "meta": { - "$ref": "#/components/schemas/_types:Metadata" - }, - "name": { - "type": "string" - } - } + "type": "object" }, "_types.aggregations:AutoDateHistogramAggregation": { "allOf": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 86165db461..24a02985a6 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -48911,31 +48911,8 @@ "name": "Aggregation", "namespace": "_types.aggregations" }, - "properties": [ - { - "name": "meta", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Metadata", - "namespace": "_types" - } - } - }, - { - "name": "name", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - ], - "specLocation": "_types/aggregations/Aggregation.ts#L22-L25" + "properties": [], + "specLocation": "_types/aggregations/Aggregation.ts#L20-L20" }, { "kind": "interface", @@ -50067,7 +50044,7 @@ } } ], - "specLocation": "_types/aggregations/AggregationContainer.ts#L106-L515", + "specLocation": "_types/aggregations/AggregationContainer.ts#L105-L514", "variants": { "kind": "container", "nonExhaustive": true @@ -56286,7 +56263,7 @@ "name": "Missing", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/AggregationContainer.ts#L517-L517", + "specLocation": "_types/aggregations/AggregationContainer.ts#L516-L516", "type": { "items": [ { @@ -56396,7 +56373,7 @@ "name": "MissingOrder", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/AggregationContainer.ts#L518-L522" + "specLocation": "_types/aggregations/AggregationContainer.ts#L517-L521" }, { "kind": "type_alias", @@ -125573,14 +125550,40 @@ { "body": { "kind": "properties", - "properties": [] + "properties": [ + { + "name": "overlapping", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Overlapping", + "namespace": "indices.simulate_template" + } + } + } + }, + { + "name": "template", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Template", + "namespace": "indices.simulate_template" + } + } + } + ] }, "kind": "response", "name": { "name": "Response", "namespace": "indices.simulate_index_template" }, - "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts#L20-L22" + "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts#L25-L30" }, { "kind": "interface", @@ -137099,7 +137102,7 @@ } } ], - "specLocation": "ml/_types/Datafeed.ts#L239-L252" + "specLocation": "ml/_types/Datafeed.ts#L238-L251" }, { "kind": "enum", @@ -137118,7 +137121,7 @@ "name": "ChunkingMode", "namespace": "ml._types" }, - "specLocation": "ml/_types/Datafeed.ts#L233-L237" + "specLocation": "ml/_types/Datafeed.ts#L232-L236" }, { "kind": "interface", @@ -137721,7 +137724,7 @@ } } ], - "specLocation": "ml/_types/Datafeed.ts#L37-L58" + "specLocation": "ml/_types/Datafeed.ts#L36-L57" }, { "kind": "interface", @@ -137979,7 +137982,7 @@ } } ], - "specLocation": "ml/_types/Datafeed.ts#L60-L117" + "specLocation": "ml/_types/Datafeed.ts#L59-L116" }, { "kind": "interface", @@ -138025,7 +138028,7 @@ } } ], - "specLocation": "ml/_types/Datafeed.ts#L198-L212" + "specLocation": "ml/_types/Datafeed.ts#L197-L211" }, { "kind": "enum", @@ -138047,7 +138050,7 @@ "name": "DatafeedState", "namespace": "ml._types" }, - "specLocation": "ml/_types/Datafeed.ts#L133-L138" + "specLocation": "ml/_types/Datafeed.ts#L132-L137" }, { "kind": "interface", @@ -138132,7 +138135,7 @@ } } ], - "specLocation": "ml/_types/Datafeed.ts#L140-L169" + "specLocation": "ml/_types/Datafeed.ts#L139-L168" }, { "kind": "interface", @@ -138241,7 +138244,7 @@ } } ], - "specLocation": "ml/_types/Datafeed.ts#L171-L196" + "specLocation": "ml/_types/Datafeed.ts#L170-L195" }, { "kind": "interface", @@ -140492,7 +140495,7 @@ } } ], - "specLocation": "ml/_types/Datafeed.ts#L119-L130" + "specLocation": "ml/_types/Datafeed.ts#L118-L129" }, { "kind": "enum", @@ -144756,7 +144759,7 @@ } } ], - "specLocation": "ml/_types/Datafeed.ts#L214-L231" + "specLocation": "ml/_types/Datafeed.ts#L213-L230" }, { "kind": "enum", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index a6df3465cf..759a42cb7e 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2853,8 +2853,7 @@ export interface AggregationsAggregateBase { export type AggregationsAggregateOrder = Partial> | Partial>[] export interface AggregationsAggregation { - meta?: Metadata - name?: string + [key: string]: never } export interface AggregationsAggregationContainer { @@ -2997,7 +2996,8 @@ export interface AggregationsBoxplotAggregation extends AggregationsMetricAggreg compression?: double } -export interface AggregationsBucketAggregationBase extends AggregationsAggregation { +export interface AggregationsBucketAggregationBase { + [key: string]: never } export interface AggregationsBucketCorrelationAggregation extends AggregationsBucketPathAggregation { @@ -3028,7 +3028,7 @@ export interface AggregationsBucketMetricValueAggregate extends AggregationsSing keys: string[] } -export interface AggregationsBucketPathAggregation extends AggregationsAggregation { +export interface AggregationsBucketPathAggregation { buckets_path?: AggregationsBucketsPath } @@ -3040,7 +3040,7 @@ export interface AggregationsBucketSelectorAggregation extends AggregationsPipel script?: Script } -export interface AggregationsBucketSortAggregation extends AggregationsAggregation { +export interface AggregationsBucketSortAggregation { from?: integer gap_policy?: AggregationsGapPolicy size?: integer @@ -3065,7 +3065,7 @@ export interface AggregationsCardinalityAggregation extends AggregationsMetricAg export type AggregationsCardinalityExecutionMode = 'global_ordinals' | 'segment_ordinals' | 'direct' | 'save_memory_heuristic' | 'save_time_heuristic' -export interface AggregationsCategorizeTextAggregation extends AggregationsAggregation { +export interface AggregationsCategorizeTextAggregation { field: Field max_unique_tokens?: integer max_matched_tokens?: integer @@ -3615,7 +3615,7 @@ export interface AggregationsLongTermsBucketKeys extends AggregationsTermsBucket export type AggregationsLongTermsBucket = AggregationsLongTermsBucketKeys & { [property: string]: AggregationsAggregate | long | string } -export interface AggregationsMatrixAggregation extends AggregationsAggregation { +export interface AggregationsMatrixAggregation { fields?: Fields missing?: Record } @@ -4072,7 +4072,7 @@ export interface AggregationsTTestAggregate extends AggregationsAggregateBase { value_as_string?: string } -export interface AggregationsTTestAggregation extends AggregationsAggregation { +export interface AggregationsTTestAggregation { a?: AggregationsTestPopulation b?: AggregationsTestPopulation type?: AggregationsTTestType @@ -4209,7 +4209,7 @@ export interface AggregationsVariableWidthHistogramBucketKeys extends Aggregatio export type AggregationsVariableWidthHistogramBucket = AggregationsVariableWidthHistogramBucketKeys & { [property: string]: AggregationsAggregate | double | string | long } -export interface AggregationsWeightedAverageAggregation extends AggregationsAggregation { +export interface AggregationsWeightedAverageAggregation { format?: string value?: AggregationsWeightedAverageValue value_type?: AggregationsValueType @@ -11212,6 +11212,8 @@ export interface IndicesSimulateIndexTemplateRequest extends RequestBase { } export interface IndicesSimulateIndexTemplateResponse { + overlapping?: IndicesSimulateTemplateOverlapping[] + template: IndicesSimulateTemplateTemplate } export interface IndicesSimulateTemplateOverlapping { diff --git a/specification/_types/aggregations/Aggregation.ts b/specification/_types/aggregations/Aggregation.ts index 13c54dc87f..24e9854c23 100644 --- a/specification/_types/aggregations/Aggregation.ts +++ b/specification/_types/aggregations/Aggregation.ts @@ -17,9 +17,4 @@ * under the License. */ -import { Metadata } from '@_types/common' - -export class Aggregation { - meta?: Metadata - name?: string -} +export class Aggregation {} diff --git a/specification/_types/aggregations/AggregationContainer.ts b/specification/_types/aggregations/AggregationContainer.ts index 4af550c9e1..7a0a1795f6 100644 --- a/specification/_types/aggregations/AggregationContainer.ts +++ b/specification/_types/aggregations/AggregationContainer.ts @@ -18,7 +18,6 @@ */ import { Dictionary } from '@spec_utils/Dictionary' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { Metadata } from '@_types/common' import { integer, double } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' diff --git a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts index 0769bf66cb..b333a4f0db 100644 --- a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts +++ b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts @@ -17,6 +17,14 @@ * under the License. */ +import { + Overlapping, + Template +} from '@indices/simulate_template/IndicesSimulateTemplateResponse' + export class Response { - body: {} + body: { + overlapping?: Overlapping[] + template: Template + } } diff --git a/specification/ml/_types/Datafeed.ts b/specification/ml/_types/Datafeed.ts index 4cd58fa3ba..8aef286f59 100644 --- a/specification/ml/_types/Datafeed.ts +++ b/specification/ml/_types/Datafeed.ts @@ -19,14 +19,13 @@ import { Dictionary } from '@spec_utils/Dictionary' import { AggregationContainer } from '@_types/aggregations/AggregationContainer' -import { ExpandWildcards, Id, Indices, IndicesOptions } from '@_types/common' +import { Id, IndicesOptions } from '@_types/common' import { RuntimeFields } from '@_types/mapping/RuntimeFields' -import { double, integer, long } from '@_types/Numeric' +import { integer, long } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' import { ScriptField } from '@_types/Scripting' import { Duration, - DateTime, DurationValue, UnitMillis, UnitFloatMillis From 992f2cdcb58c834c9e6d6cd4854691eb7114434f Mon Sep 17 00:00:00 2001 From: Laura Date: Wed, 3 Apr 2024 14:21:45 +0200 Subject: [PATCH 12/18] sim index req name optional --- output/schema/schema.json | 2 +- output/schema/validation-errors.json | 1 + output/typescript/types.ts | 2 +- .../IndicesSimulateIndexTemplateRequest.ts | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 24a02985a6..ea79a283b8 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -125483,7 +125483,7 @@ { "description": "Index or template name to simulate", "name": "name", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 38579e45cd..b6f4333931 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -870,6 +870,7 @@ }, "indices.simulate_index_template": { "request": [ + "Request: path parameter 'name' is required in the json spec", "Request: missing json spec query parameter 'cause'" ], "response": [] diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 759a42cb7e..f161605080 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11195,7 +11195,7 @@ export interface IndicesShrinkResponse { } export interface IndicesSimulateIndexTemplateRequest extends RequestBase { - name: Name + name?: Name create?: boolean master_timeout?: Duration include_defaults?: boolean diff --git a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts index 44899682ce..d846e6ee1c 100644 --- a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts +++ b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts @@ -39,7 +39,7 @@ import { IndexTemplateMapping } from '../put_index_template/IndicesPutIndexTempl export interface Request extends RequestBase { path_parts: { /** Index or template name to simulate */ - name: Name + name?: Name } query_parameters: { /** From cbf7c214a5538a697773a7c22738da96dd7bf45d Mon Sep 17 00:00:00 2001 From: Laura Date: Wed, 3 Apr 2024 17:41:22 +0200 Subject: [PATCH 13/18] added new class learning_to_rank to rescore (506) --- .../elasticsearch-serverless-openapi.json | 45 +++++++++--- output/schema/schema.json | 73 +++++++++++++++++-- output/typescript/types.ts | 8 +- .../_global/search/_types/rescoring.ts | 25 ++++++- .../IndicesSimulateIndexTemplateRequest.ts | 8 +- 5 files changed, 133 insertions(+), 26 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 2c2247a8c0..d905c25358 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -39588,17 +39588,28 @@ } }, "_global.search._types:Rescore": { - "type": "object", - "properties": { - "query": { - "$ref": "#/components/schemas/_global.search._types:RescoreQuery" + "allOf": [ + { + "type": "object", + "properties": { + "window_size": { + "type": "number" + } + } }, - "window_size": { - "type": "number" + { + "type": "object", + "properties": { + "query": { + "$ref": "#/components/schemas/_global.search._types:RescoreQuery" + }, + "learning_to_rank": { + "$ref": "#/components/schemas/_global.search._types:LearningToRank" + } + }, + "minProperties": 1, + "maxProperties": 1 } - }, - "required": [ - "query" ] }, "_global.search._types:RescoreQuery": { @@ -39633,6 +39644,22 @@ "total" ] }, + "_global.search._types:LearningToRank": { + "type": "object", + "properties": { + "model_id": { + "description": "The unique identifier of the trained model uploaded to Elasticsearch", + "type": "string" + }, + "params": { + "description": "Named parameters to be passed to the query templates used for feature", + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, "_types:SlicedScroll": { "type": "object", "properties": { diff --git a/output/schema/schema.json b/output/schema/schema.json index ea79a283b8..2ddcf2f192 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -35142,6 +35142,47 @@ ], "specLocation": "_global/search/_types/suggester.ts#L427-L432" }, + { + "kind": "interface", + "name": { + "name": "LearningToRank", + "namespace": "_global.search._types" + }, + "properties": [ + { + "description": "The unique identifier of the trained model uploaded to Elasticsearch", + "name": "model_id", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "Named parameters to be passed to the query templates used for feature", + "name": "params", + "required": false, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "user_defined_value" + } + } + } + ], + "specLocation": "_global/search/_types/rescoring.ts#L88-L97" + }, { "kind": "interface", "name": { @@ -36020,9 +36061,21 @@ "namespace": "_global.search._types" }, "properties": [ + { + "containerProperty": true, + "name": "window_size", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, { "name": "query", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -36032,18 +36085,22 @@ } }, { - "name": "window_size", + "name": "learning_to_rank", "required": false, "type": { "kind": "instance_of", "type": { - "name": "integer", - "namespace": "_types" + "name": "LearningToRank", + "namespace": "_global.search._types" } } } ], - "specLocation": "_global/search/_types/rescoring.ts#L23-L26" + "specLocation": "_global/search/_types/rescoring.ts#L25-L38", + "variants": { + "kind": "container", + "nonExhaustive": true + } }, { "kind": "interface", @@ -36105,7 +36162,7 @@ } } ], - "specLocation": "_global/search/_types/rescoring.ts#L28-L50" + "specLocation": "_global/search/_types/rescoring.ts#L40-L62" }, { "kind": "enum", @@ -36135,7 +36192,7 @@ "name": "ScoreMode", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/rescoring.ts#L52-L74" + "specLocation": "_global/search/_types/rescoring.ts#L64-L86" }, { "kind": "interface", @@ -125545,7 +125602,7 @@ } } ], - "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L33-L115" + "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L32-L114" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index f161605080..5c3103edb9 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -1505,6 +1505,11 @@ export interface SearchLaplaceSmoothingModel { alpha: double } +export interface SearchLearningToRank { + model_id?: string + params?: Record +} + export interface SearchLinearInterpolationSmoothingModel { bigram_lambda: double trigram_lambda: double @@ -1604,8 +1609,9 @@ export interface SearchRegexOptions { } export interface SearchRescore { - query: SearchRescoreQuery window_size?: integer + query?: SearchRescoreQuery + learning_to_rank?: SearchLearningToRank } export interface SearchRescoreQuery { diff --git a/specification/_global/search/_types/rescoring.ts b/specification/_global/search/_types/rescoring.ts index e144891920..8b14b6848a 100644 --- a/specification/_global/search/_types/rescoring.ts +++ b/specification/_global/search/_types/rescoring.ts @@ -19,10 +19,22 @@ import { double, integer } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' +import { Dictionary } from '@spec_utils/Dictionary' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' +/** + * @variants container + * @non_exhaustive + */ export class Rescore { - query: RescoreQuery + /** + * @variant container_property + */ window_size?: integer + + query?: RescoreQuery + + learning_to_rank?: LearningToRank } export class RescoreQuery { @@ -72,3 +84,14 @@ export enum ScoreMode { */ total } + +export class LearningToRank { + /** + * The unique identifier of the trained model uploaded to Elasticsearch + */ + model_id?: string + /** + * Named parameters to be passed to the query templates used for feature + */ + params?: Dictionary +} diff --git a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts index d846e6ee1c..7f2cb743cc 100644 --- a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts +++ b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts @@ -19,13 +19,7 @@ import { DataStreamVisibility } from '@indices/_types/DataStream' import { RequestBase } from '@_types/Base' -import { - IndexName, - Indices, - Metadata, - Name, - VersionNumber -} from '@_types/common' +import { Indices, Metadata, Name, VersionNumber } from '@_types/common' import { Duration } from '@_types/Time' import { integer } from '@_types/Numeric' import { IndexTemplateMapping } from '../put_index_template/IndicesPutIndexTemplateRequest' From 9ce7f2cdf4ffd8fd7836b5793ba55f5dfab8c035 Mon Sep 17 00:00:00 2001 From: Laura Date: Thu, 4 Apr 2024 16:07:13 +0200 Subject: [PATCH 14/18] fixed simulate index template and simulate template --- .../elasticsearch-serverless-openapi.json | 112 +++----- output/schema/schema.json | 272 ++++++++---------- output/schema/validation-errors.json | 5 +- output/typescript/types.ts | 25 +- .../IndicesSimulateIndexTemplateRequest.ts | 77 +---- .../IndicesSimulateTemplateRequest.ts | 61 +++- 6 files changed, 227 insertions(+), 325 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index d905c25358..b69c18bc73 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -7090,79 +7090,8 @@ "$ref": "#/components/schemas/_types:Name" }, "style": "simple" - }, - { - "in": "query", - "name": "create", - "description": "If `true`, the template passed in the body is only used if no existing\ntemplates match the same index patterns. If `false`, the simulation uses\nthe template with the highest priority. Note that the template is not\npermanently added or updated in either case; it is only used for the\nsimulation.", - "deprecated": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "in": "query", - "name": "master_timeout", - "description": "Period to wait for a connection to the master node. If no response is received\nbefore the timeout expires, the request fails and returns an error.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types:Duration" - }, - "style": "form" - }, - { - "in": "query", - "name": "include_defaults", - "description": "If true, returns all relevant default configurations for the index template.", - "deprecated": false, - "schema": { - "type": "boolean" - }, - "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "allow_auto_create": { - "description": "This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.", - "type": "boolean" - }, - "index_patterns": { - "$ref": "#/components/schemas/_types:Indices" - }, - "composed_of": { - "description": "An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence.", - "type": "array", - "items": { - "$ref": "#/components/schemas/_types:Name" - } - }, - "template": { - "$ref": "#/components/schemas/indices.put_index_template:IndexTemplateMapping" - }, - "data_stream": { - "$ref": "#/components/schemas/indices._types:DataStreamVisibility" - }, - "priority": { - "description": "Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch.", - "type": "number" - }, - "version": { - "$ref": "#/components/schemas/_types:VersionNumber" - }, - "_meta": { - "$ref": "#/components/schemas/_types:Metadata" - } - } - } - } - } - }, "responses": { "200": { "description": "", @@ -26336,7 +26265,46 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/indices._types:IndexTemplate" + "type": "object", + "properties": { + "allow_auto_create": { + "description": "This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.", + "type": "boolean" + }, + "index_patterns": { + "$ref": "#/components/schemas/_types:Indices" + }, + "composed_of": { + "description": "An ordered list of component template names.\nComponent templates are merged in the order specified, meaning that the last component template specified has the highest precedence.", + "type": "array", + "items": { + "$ref": "#/components/schemas/_types:Name" + } + }, + "template": { + "$ref": "#/components/schemas/indices.put_index_template:IndexTemplateMapping" + }, + "data_stream": { + "$ref": "#/components/schemas/indices._types:DataStreamVisibility" + }, + "priority": { + "description": "Priority to determine index template precedence when a new data stream or index is created.\nThe index template with the highest priority is chosen.\nIf no priority is specified the template is treated as though it is of priority 0 (lowest priority).\nThis number is not automatically generated by Elasticsearch.", + "type": "number" + }, + "version": { + "$ref": "#/components/schemas/_types:VersionNumber" + }, + "_meta": { + "$ref": "#/components/schemas/_types:Metadata" + }, + "ignore_missing_component_templates": { + "description": "The configuration option ignore_missing_component_templates can be used when an index template\nreferences a component template that might not exist", + "type": "array", + "items": { + "type": "string" + } + } + } } } } diff --git a/output/schema/schema.json b/output/schema/schema.json index 2ddcf2f192..627ceb0e07 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -125412,6 +125412,115 @@ }, "specLocation": "indices/shrink/IndicesShrinkResponse.ts#L22-L28" }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "indices.simulate_index_template" + }, + "path": [ + { + "description": "Index or template name to simulate", + "name": "name", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Name", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L23-L34" + }, + { + "body": { + "kind": "properties", + "properties": [ + { + "name": "overlapping", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Overlapping", + "namespace": "indices.simulate_template" + } + } + } + }, + { + "name": "template", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Template", + "namespace": "indices.simulate_template" + } + } + } + ] + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "indices.simulate_index_template" + }, + "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts#L25-L30" + }, + { + "kind": "interface", + "name": { + "name": "Overlapping", + "namespace": "indices.simulate_template" + }, + "properties": [ + { + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Name", + "namespace": "_types" + } + } + }, + { + "name": "index_patterns", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + } + ], + "specLocation": "indices/simulate_template/IndicesSimulateTemplateResponse.ts#L39-L42" + }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -125521,177 +125630,24 @@ "namespace": "_types" } } - } - ] - }, - "description": "", - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "kind": "request", - "name": { - "name": "Request", - "namespace": "indices.simulate_index_template" - }, - "path": [ - { - "description": "Index or template name to simulate", - "name": "name", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Name", - "namespace": "_types" - } - } - } - ], - "query": [ - { - "description": "If `true`, the template passed in the body is only used if no existing\ntemplates match the same index patterns. If `false`, the simulation uses\nthe template with the highest priority. Note that the template is not\npermanently added or updated in either case; it is only used for the\nsimulation.", - "name": "create", - "required": false, - "serverDefault": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - }, - { - "description": "Period to wait for a connection to the master node. If no response is received\nbefore the timeout expires, the request fails and returns an error.", - "name": "master_timeout", - "required": false, - "serverDefault": "30s", - "type": { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - }, - { - "availability": { - "serverless": { - "stability": "stable" - }, - "stack": { - "since": "8.11.0", - "stability": "stable" - } }, - "description": "If true, returns all relevant default configurations for the index template.", - "name": "include_defaults", - "required": false, - "serverDefault": false, - "since": "8.11.0", - "stability": "stable", - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - } - ], - "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L32-L114" - }, - { - "body": { - "kind": "properties", - "properties": [ { - "name": "overlapping", + "description": "The configuration option ignore_missing_component_templates can be used when an index template\nreferences a component template that might not exist", + "name": "ignore_missing_component_templates", "required": false, "type": { "kind": "array_of", "value": { "kind": "instance_of", "type": { - "name": "Overlapping", - "namespace": "indices.simulate_template" + "name": "string", + "namespace": "_builtins" } } } - }, - { - "name": "template", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Template", - "namespace": "indices.simulate_template" - } - } } ] }, - "kind": "response", - "name": { - "name": "Response", - "namespace": "indices.simulate_index_template" - }, - "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts#L25-L30" - }, - { - "kind": "interface", - "name": { - "name": "Overlapping", - "namespace": "indices.simulate_template" - }, - "properties": [ - { - "name": "name", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Name", - "namespace": "_types" - } - } - }, - { - "name": "index_patterns", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - } - ], - "specLocation": "indices/simulate_template/IndicesSimulateTemplateResponse.ts#L39-L42" - }, - { - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "codegenName": "template", - "kind": "value", - "value": { - "kind": "instance_of", - "type": { - "name": "IndexTemplate", - "namespace": "indices._types" - } - } - }, "description": "Returns the index configuration that would be applied by a particular index template.", "inherits": { "type": { @@ -125770,7 +125726,7 @@ } } ], - "specLocation": "indices/simulate_template/IndicesSimulateTemplateRequest.ts#L25-L61" + "specLocation": "indices/simulate_template/IndicesSimulateTemplateRequest.ts#L27-L114" }, { "body": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index b6f4333931..8a48bec293 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -871,7 +871,10 @@ "indices.simulate_index_template": { "request": [ "Request: path parameter 'name' is required in the json spec", - "Request: missing json spec query parameter 'cause'" + "Request: missing json spec query parameter 'create'", + "Request: missing json spec query parameter 'cause'", + "Request: missing json spec query parameter 'master_timeout'", + "Request: missing json spec query parameter 'include_defaults'" ], "response": [] }, diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 5c3103edb9..3042f6e65f 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11202,19 +11202,6 @@ export interface IndicesShrinkResponse { export interface IndicesSimulateIndexTemplateRequest extends RequestBase { name?: Name - create?: boolean - master_timeout?: Duration - include_defaults?: boolean - body?: { - allow_auto_create?: boolean - index_patterns?: Indices - composed_of?: Name[] - template?: IndicesPutIndexTemplateIndexTemplateMapping - data_stream?: IndicesDataStreamVisibility - priority?: integer - version?: VersionNumber - _meta?: Metadata - } } export interface IndicesSimulateIndexTemplateResponse { @@ -11232,7 +11219,17 @@ export interface IndicesSimulateTemplateRequest extends RequestBase { create?: boolean master_timeout?: Duration include_defaults?: boolean - body?: IndicesIndexTemplate + body?: { + allow_auto_create?: boolean + index_patterns?: Indices + composed_of?: Name[] + template?: IndicesPutIndexTemplateIndexTemplateMapping + data_stream?: IndicesDataStreamVisibility + priority?: integer + version?: VersionNumber + _meta?: Metadata + ignore_missing_component_templates?: string[] + } } export interface IndicesSimulateTemplateResponse { diff --git a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts index 7f2cb743cc..85a73e72d7 100644 --- a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts +++ b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts @@ -17,12 +17,8 @@ * under the License. */ -import { DataStreamVisibility } from '@indices/_types/DataStream' import { RequestBase } from '@_types/Base' -import { Indices, Metadata, Name, VersionNumber } from '@_types/common' -import { Duration } from '@_types/Time' -import { integer } from '@_types/Numeric' -import { IndexTemplateMapping } from '../put_index_template/IndicesPutIndexTemplateRequest' +import { Name } from '@_types/common' /** * @@ -35,75 +31,4 @@ export interface Request extends RequestBase { /** Index or template name to simulate */ name?: Name } - query_parameters: { - /** - * If `true`, the template passed in the body is only used if no existing - * templates match the same index patterns. If `false`, the simulation uses - * the template with the highest priority. Note that the template is not - * permanently added or updated in either case; it is only used for the - * simulation. - * @server_default false - * */ - create?: boolean - /** - * Period to wait for a connection to the master node. If no response is received - * before the timeout expires, the request fails and returns an error. - * @server_default 30s - */ - master_timeout?: Duration - /** - * If true, returns all relevant default configurations for the index template. - * @server_default false - * @availability stack since=8.11.0 stability=stable - * @availability serverless stability=stable - */ - include_defaults?: boolean - } - body: { - /** - * This setting overrides the value of the `action.auto_create_index` cluster setting. - * If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. - * If set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. - */ - allow_auto_create?: boolean - /** - * Array of wildcard (`*`) expressions used to match the names of data streams and indices during creation. - * @doc_id avoid-index-pattern-collisions - */ - index_patterns?: Indices - /** - * An ordered list of component template names. - * Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. - */ - composed_of?: Name[] - /** - * Template to be applied. - * It may optionally include an `aliases`, `mappings`, or `settings` configuration. - */ - template?: IndexTemplateMapping - /** - * If this object is included, the template is used to create data streams and their backing indices. - * Supports an empty object. - * Data streams require a matching index template with a `data_stream` object. - */ - data_stream?: DataStreamVisibility - /** - * Priority to determine index template precedence when a new data stream or index is created. - * The index template with the highest priority is chosen. - * If no priority is specified the template is treated as though it is of priority 0 (lowest priority). - * This number is not automatically generated by Elasticsearch. - */ - priority?: integer - /** - * Version number used to manage index templates externally. - * This number is not automatically generated by Elasticsearch. - */ - version?: VersionNumber - /** - * Optional user metadata about the index template. - * May have any contents. - * This map is not automatically generated by Elasticsearch. - * @doc_id mapping-meta-field */ - _meta?: Metadata - } } diff --git a/specification/indices/simulate_template/IndicesSimulateTemplateRequest.ts b/specification/indices/simulate_template/IndicesSimulateTemplateRequest.ts index 7af09e2292..cde9569914 100644 --- a/specification/indices/simulate_template/IndicesSimulateTemplateRequest.ts +++ b/specification/indices/simulate_template/IndicesSimulateTemplateRequest.ts @@ -17,10 +17,12 @@ * under the License. */ -import { IndexTemplate } from '@indices/_types/IndexTemplate' import { RequestBase } from '@_types/Base' -import { Name } from '@_types/common' +import { Indices, Metadata, Name, VersionNumber } from '@_types/common' import { Duration } from '@_types/Time' +import { IndexTemplateMapping } from '@indices/put_index_template/IndicesPutIndexTemplateRequest' +import { DataStreamVisibility } from '@indices/_types/DataStream' +import { integer } from '@_types/Numeric' /** * Returns the index configuration that would be applied by a particular index template. @@ -56,6 +58,57 @@ export interface Request extends RequestBase { */ include_defaults?: boolean } - /** @codegen_name template */ - body?: IndexTemplate + body: { + /** + * This setting overrides the value of the `action.auto_create_index` cluster setting. + * If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. + * If set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. + */ + allow_auto_create?: boolean + /** + * Array of wildcard (`*`) expressions used to match the names of data streams and indices during creation. + * @doc_id avoid-index-pattern-collisions + */ + index_patterns?: Indices + /** + * An ordered list of component template names. + * Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. + */ + composed_of?: Name[] + /** + * Template to be applied. + * It may optionally include an `aliases`, `mappings`, or `settings` configuration. + */ + template?: IndexTemplateMapping + /** + * If this object is included, the template is used to create data streams and their backing indices. + * Supports an empty object. + * Data streams require a matching index template with a `data_stream` object. + */ + data_stream?: DataStreamVisibility + /** + * Priority to determine index template precedence when a new data stream or index is created. + * The index template with the highest priority is chosen. + * If no priority is specified the template is treated as though it is of priority 0 (lowest priority). + * This number is not automatically generated by Elasticsearch. + */ + priority?: integer + /** + * Version number used to manage index templates externally. + * This number is not automatically generated by Elasticsearch. + */ + version?: VersionNumber + /** + * Optional user metadata about the index template. + * May have any contents. + * This map is not automatically generated by Elasticsearch. + * @doc_id mapping-meta-field */ + _meta?: Metadata + + /** + * The configuration option ignore_missing_component_templates can be used when an index template + * references a component template that might not exist + */ + ignore_missing_component_templates?: string[] + } } From abe582362e9bc05216a1ed034d7676e08e85a0e3 Mon Sep 17 00:00:00 2001 From: Laura Date: Thu, 4 Apr 2024 16:26:38 +0200 Subject: [PATCH 15/18] sim index temp name required, added query params --- .../elasticsearch-serverless-openapi.json | 22 ++++++++- output/schema/schema.json | 46 +++++++++++++++++-- output/schema/validation-errors.json | 5 +- output/typescript/types.ts | 4 +- .../IndicesSimulateIndexTemplateRequest.ts | 19 +++++++- 5 files changed, 84 insertions(+), 12 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index b69c18bc73..353b107b04 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -7083,13 +7083,33 @@ { "in": "path", "name": "name", - "description": "Index or template name to simulate", + "description": "Name of the index to simulate", "required": true, "deprecated": false, "schema": { "$ref": "#/components/schemas/_types:Name" }, "style": "simple" + }, + { + "in": "query", + "name": "master_timeout", + "description": "Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Duration" + }, + "style": "form" + }, + { + "in": "query", + "name": "include_defaults", + "description": "If true, returns all relevant default configurations for the index template.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" } ], "responses": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 627ceb0e07..5611b12931 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -125433,9 +125433,9 @@ }, "path": [ { - "description": "Index or template name to simulate", + "description": "Name of the index to simulate", "name": "name", - "required": false, + "required": true, "type": { "kind": "instance_of", "type": { @@ -125445,8 +125445,46 @@ } } ], - "query": [], - "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L23-L34" + "query": [ + { + "description": "Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "availability": { + "serverless": { + "stability": "stable" + }, + "stack": { + "since": "8.11.0", + "stability": "stable" + } + }, + "description": "If true, returns all relevant default configurations for the index template.", + "name": "include_defaults", + "required": false, + "serverDefault": false, + "since": "8.11.0", + "stability": "stable", + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L24-L49" }, { "body": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 8a48bec293..326996873f 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -870,11 +870,8 @@ }, "indices.simulate_index_template": { "request": [ - "Request: path parameter 'name' is required in the json spec", "Request: missing json spec query parameter 'create'", - "Request: missing json spec query parameter 'cause'", - "Request: missing json spec query parameter 'master_timeout'", - "Request: missing json spec query parameter 'include_defaults'" + "Request: missing json spec query parameter 'cause'" ], "response": [] }, diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3042f6e65f..a6ba2a0d7c 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11201,7 +11201,9 @@ export interface IndicesShrinkResponse { } export interface IndicesSimulateIndexTemplateRequest extends RequestBase { - name?: Name + name: Name + master_timeout?: Duration + include_defaults?: boolean } export interface IndicesSimulateIndexTemplateResponse { diff --git a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts index 85a73e72d7..b4d1d32b00 100644 --- a/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts +++ b/specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts @@ -19,6 +19,7 @@ import { RequestBase } from '@_types/Base' import { Name } from '@_types/common' +import { Duration } from '@_types/Time' /** * @@ -28,7 +29,21 @@ import { Name } from '@_types/common' */ export interface Request extends RequestBase { path_parts: { - /** Index or template name to simulate */ - name?: Name + /** Name of the index to simulate */ + name: Name + } + query_parameters: { + /** + * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @server_default 30s + */ + master_timeout?: Duration + /** + * If true, returns all relevant default configurations for the index template. + * @server_default false + * @availability stack since=8.11.0 stability=stable + * @availability serverless stability=stable + */ + include_defaults?: boolean } } From d2012c1c8191f42a754698c4a4451b269c88496f Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Thu, 4 Apr 2024 17:40:15 +0200 Subject: [PATCH 16/18] Revert "allow_auto_create added to putIndexTemplate req (571)" This reverts commit de46d9e35edbc1ceef3b830db6f66e0c1a038457. --- .../elasticsearch-serverless-openapi.json | 16 +++++++++------ output/schema/schema.json | 20 ++++--------------- output/typescript/types.ts | 5 ++--- .../IndicesPutIndexTemplateRequest.ts | 6 ------ 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 353b107b04..747973f832 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -26082,10 +26082,6 @@ "schema": { "type": "object", "properties": { - "allow_auto_create": { - "description": "This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.", - "type": "boolean" - }, "index_patterns": { "$ref": "#/components/schemas/_types:Indices" }, @@ -37443,7 +37439,11 @@ "min": { "$ref": "#/components/schemas/_types.aggregations:FieldDateMath" } - } + }, + "required": [ + "max", + "min" + ] }, "_types.aggregations:FieldDateMath": { "description": "A date range limit, represented either as a DateMath expression or a number expressed\naccording to the target field's precision.", @@ -38074,7 +38074,11 @@ "description": "Minimum value for the bound.", "type": "number" } - } + }, + "required": [ + "max", + "min" + ] }, "_types.aggregations:IpRangeAggregation": { "allOf": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 5611b12931..c6b984b640 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -52864,7 +52864,7 @@ { "description": "Maximum value for the bound.", "name": "max", - "required": false, + "required": true, "type": { "kind": "instance_of", "type": { @@ -52876,7 +52876,7 @@ { "description": "Minimum value for the bound.", "name": "min", - "required": false, + "required": true, "type": { "kind": "instance_of", "type": { @@ -121317,7 +121317,7 @@ } } ], - "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L103-L125" + "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L97-L119" }, { "attachedBehaviors": [ @@ -121326,18 +121326,6 @@ "body": { "kind": "properties", "properties": [ - { - "description": "This setting overrides the value of the `action.auto_create_index` cluster setting.\nIf set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`.\nIf set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created.", - "name": "allow_auto_create", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - }, { "description": "Name of the index template to create.", "name": "index_patterns", @@ -121470,7 +121458,7 @@ } } ], - "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L36-L101" + "specLocation": "indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L36-L95" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index a6ba2a0d7c..cfd260202a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -3253,8 +3253,8 @@ export interface AggregationsEwmaMovingAverageAggregation extends AggregationsMo } export interface AggregationsExtendedBounds { - max?: T - min?: T + max: T + min: T } export interface AggregationsExtendedStatsAggregate extends AggregationsStatsAggregate { @@ -10797,7 +10797,6 @@ export interface IndicesPutIndexTemplateRequest extends RequestBase { name: Name create?: boolean body?: { - allow_auto_create?: boolean index_patterns?: Indices composed_of?: Name[] template?: IndicesPutIndexTemplateIndexTemplateMapping diff --git a/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts b/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts index c78330b7e6..b3a6a533c4 100644 --- a/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts +++ b/specification/indices/put_index_template/IndicesPutIndexTemplateRequest.ts @@ -46,12 +46,6 @@ export interface Request extends RequestBase { name: Name } body: { - /** - * This setting overrides the value of the `action.auto_create_index` cluster setting. - * If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. - * If set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. - */ - allow_auto_create?: boolean /** * Name of the index template to create. */ From bb4a3dfc449d1fce5ebaa2215fd1588c38beea6b Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Thu, 4 Apr 2024 18:04:04 +0200 Subject: [PATCH 17/18] regen --- output/openapi/elasticsearch-serverless-openapi.json | 12 ++---------- output/schema/schema.json | 4 ++-- output/typescript/types.ts | 4 ++-- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 747973f832..d691ea20a8 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -37439,11 +37439,7 @@ "min": { "$ref": "#/components/schemas/_types.aggregations:FieldDateMath" } - }, - "required": [ - "max", - "min" - ] + } }, "_types.aggregations:FieldDateMath": { "description": "A date range limit, represented either as a DateMath expression or a number expressed\naccording to the target field's precision.", @@ -38074,11 +38070,7 @@ "description": "Minimum value for the bound.", "type": "number" } - }, - "required": [ - "max", - "min" - ] + } }, "_types.aggregations:IpRangeAggregation": { "allOf": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index c6b984b640..f88e3a6ea1 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -52864,7 +52864,7 @@ { "description": "Maximum value for the bound.", "name": "max", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -52876,7 +52876,7 @@ { "description": "Minimum value for the bound.", "name": "min", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index cfd260202a..22a91d5676 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -3253,8 +3253,8 @@ export interface AggregationsEwmaMovingAverageAggregation extends AggregationsMo } export interface AggregationsExtendedBounds { - max: T - min: T + max?: T + min?: T } export interface AggregationsExtendedStatsAggregate extends AggregationsStatsAggregate { From 18e477a34a439ec8985dfd7b694becb9f311e428 Mon Sep 17 00:00:00 2001 From: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Date: Fri, 5 Apr 2024 12:53:50 +0200 Subject: [PATCH 18/18] Update specification/_global/search/_types/rescoring.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit model_id in ltr rescorer should not be optional Co-authored-by: Laurent Saint-Félix --- specification/_global/search/_types/rescoring.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/_global/search/_types/rescoring.ts b/specification/_global/search/_types/rescoring.ts index 8b14b6848a..ede27346ed 100644 --- a/specification/_global/search/_types/rescoring.ts +++ b/specification/_global/search/_types/rescoring.ts @@ -89,7 +89,7 @@ export class LearningToRank { /** * The unique identifier of the trained model uploaded to Elasticsearch */ - model_id?: string + model_id: string /** * Named parameters to be passed to the query templates used for feature */