From a921b93dec4f07588d37c6e0167ef9c68cdaaea1 Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Tue, 28 Jun 2022 13:54:20 +0200 Subject: [PATCH] Misc java fixes 220617 (#1773) * Fix MultiTermsRequest - elastic/elasticsearch-java#160 * TypeFieldMappings is a multi-key dictionary - elastic/elasticsearch-java#166 * Fix TranslateSqlResponse - elastic/elasticsearch-java#167 * Token filter properties are generally optional - elastic/elasticsearch-java#199 * Fix typo in IndexSettings.mapping and allow extended settings - elastic/elasticsearch-java#295 * ShardRecovery.stop_time_in_millis is optional - elastic/elasticsearch-java#202 --- .gitignore | 8 + output/schema/schema.json | 540 +++++++++++------- output/typescript/types.ts | 141 ++--- specification/_spec_utils/Stringified.ts | 27 + specification/_types/aggregations/bucket.ts | 26 +- .../_types/analysis/token_filters.ts | 50 +- specification/indices/_types/IndexSettings.ts | 18 +- .../indices/get_field_mapping/types.ts | 4 +- specification/indices/recovery/types.ts | 2 +- .../sql/translate/TranslateSqlResponse.ts | 13 +- 10 files changed, 478 insertions(+), 351 deletions(-) create mode 100644 specification/_spec_utils/Stringified.ts diff --git a/.gitignore b/.gitignore index 28f0871e57..126fc4a283 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,11 @@ artifacts .validation.json compiler/lib typescript-generator/lib + +report +output/schema/import-* +output/schema/schema-no-generics.json +.github/**/package-lock.json + +# Editor lockfiles +.*.swp diff --git a/output/schema/schema.json b/output/schema/schema.json index 019456680a..350deb2a64 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -38609,6 +38609,58 @@ ], "specLocation": "_types/aggregations/Aggregate.ts#L123-L125" }, + { + "kind": "type_alias", + "name": { + "name": "AggregateOrder", + "namespace": "_types.aggregations" + }, + "specLocation": "_types/aggregations/bucket.ts#L361-L363", + "type": { + "items": [ + { + "key": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + "kind": "dictionary_of", + "singleKey": true, + "value": { + "kind": "instance_of", + "type": { + "name": "SortOrder", + "namespace": "_types" + } + } + }, + { + "kind": "array_of", + "value": { + "key": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + "kind": "dictionary_of", + "singleKey": true, + "value": { + "kind": "instance_of", + "type": { + "name": "SortOrder", + "namespace": "_types" + } + } + } + } + ], + "kind": "union_of" + } + }, { "kind": "interface", "name": { @@ -39543,7 +39595,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L261-L265" + "specLocation": "_types/aggregations/bucket.ts#L263-L267" }, { "kind": "interface", @@ -40424,7 +40476,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L285-L288" + "specLocation": "_types/aggregations/bucket.ts#L287-L290" }, { "attachedBehaviors": [ @@ -41013,7 +41065,7 @@ "type": { "kind": "instance_of", "type": { - "name": "HistogramOrder", + "name": "AggregateOrder", "namespace": "_types.aggregations" } } @@ -42730,7 +42782,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L290-L292" + "specLocation": "_types/aggregations/bucket.ts#L292-L294" }, { "kind": "interface", @@ -42924,7 +42976,7 @@ "type": { "kind": "instance_of", "type": { - "name": "HistogramOrder", + "name": "AggregateOrder", "namespace": "_types.aggregations" } } @@ -43006,38 +43058,6 @@ ], "specLocation": "_types/aggregations/Aggregate.ts#L330-L333" }, - { - "kind": "interface", - "name": { - "name": "HistogramOrder", - "namespace": "_types.aggregations" - }, - "properties": [ - { - "name": "_count", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "SortOrder", - "namespace": "_types" - } - } - }, - { - "name": "_key", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "SortOrder", - "namespace": "_types" - } - } - } - ], - "specLocation": "_types/aggregations/bucket.ts#L216-L219" - }, { "kind": "interface", "name": { @@ -43581,7 +43601,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L221-L224" + "specLocation": "_types/aggregations/bucket.ts#L216-L219" }, { "kind": "interface", @@ -43624,7 +43644,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L226-L230" + "specLocation": "_types/aggregations/bucket.ts#L221-L225" }, { "attachedBehaviors": [ @@ -44421,7 +44441,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L232-L235" + "specLocation": "_types/aggregations/bucket.ts#L227-L230" }, { "kind": "enum", @@ -44751,7 +44771,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L241-L243" + "specLocation": "_types/aggregations/bucket.ts#L243-L245" }, { "inherits": { @@ -44791,6 +44811,83 @@ "namespace": "_types.aggregations" }, "properties": [ + { + "name": "collect_mode", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TermsAggregationCollectMode", + "namespace": "_types.aggregations" + } + } + }, + { + "name": "order", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "AggregateOrder", + "namespace": "_types.aggregations" + } + } + }, + { + "name": "min_doc_count", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "shard_min_doc_count", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "shard_size", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "show_term_doc_count_error", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "size", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, { "name": "terms", "required": true, @@ -44806,7 +44903,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L237-L239" + "specLocation": "_types/aggregations/bucket.ts#L232-L241" }, { "attachedBehaviors": [ @@ -44912,7 +45009,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L294-L297" + "specLocation": "_types/aggregations/bucket.ts#L296-L299" }, { "attachedBehaviors": [ @@ -44958,7 +45055,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L245-L247" + "specLocation": "_types/aggregations/bucket.ts#L247-L249" }, { "inherits": { @@ -45060,7 +45157,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L249-L251" + "specLocation": "_types/aggregations/bucket.ts#L251-L253" }, { "kind": "interface", @@ -45069,7 +45166,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/bucket.ts#L299-L299" + "specLocation": "_types/aggregations/bucket.ts#L301-L301" }, { "inherits": { @@ -45462,7 +45559,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L253-L259" + "specLocation": "_types/aggregations/bucket.ts#L255-L261" }, { "attachedBehaviors": [ @@ -45630,7 +45727,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L267-L275" + "specLocation": "_types/aggregations/bucket.ts#L269-L277" }, { "inherits": { @@ -45804,7 +45901,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L277-L279" + "specLocation": "_types/aggregations/bucket.ts#L279-L281" }, { "attachedBehaviors": [ @@ -45850,7 +45947,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L281-L283" + "specLocation": "_types/aggregations/bucket.ts#L283-L285" }, { "kind": "enum", @@ -45890,7 +45987,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L301-L303" + "specLocation": "_types/aggregations/bucket.ts#L303-L305" }, { "inherits": { @@ -46310,7 +46407,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L305-L320" + "specLocation": "_types/aggregations/bucket.ts#L307-L322" }, { "attachedBehaviors": [ @@ -46558,7 +46655,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L322-L339" + "specLocation": "_types/aggregations/bucket.ts#L324-L341" }, { "inherits": { @@ -47867,7 +47964,7 @@ "type": { "kind": "instance_of", "type": { - "name": "TermsAggregationOrder", + "name": "AggregateOrder", "namespace": "_types.aggregations" } } @@ -47917,7 +48014,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L341-L357" + "specLocation": "_types/aggregations/bucket.ts#L343-L359" }, { "kind": "enum", @@ -47933,7 +48030,7 @@ "name": "TermsAggregationCollectMode", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L363-L366" + "specLocation": "_types/aggregations/bucket.ts#L365-L368" }, { "kind": "enum", @@ -47955,59 +48052,7 @@ "name": "TermsAggregationExecutionHint", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L368-L373" - }, - { - "kind": "type_alias", - "name": { - "name": "TermsAggregationOrder", - "namespace": "_types.aggregations" - }, - "specLocation": "_types/aggregations/bucket.ts#L359-L361", - "type": { - "items": [ - { - "key": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "SortOrder", - "namespace": "_types" - } - } - }, - { - "kind": "array_of", - "value": { - "key": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "SortOrder", - "namespace": "_types" - } - } - } - } - ], - "kind": "union_of" - } + "specLocation": "_types/aggregations/bucket.ts#L370-L375" }, { "attachedBehaviors": [ @@ -48049,7 +48094,7 @@ "name": "TermsExclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L378-L379", + "specLocation": "_types/aggregations/bucket.ts#L380-L381", "type": { "items": [ { @@ -48084,7 +48129,7 @@ "name": "TermsInclude", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/bucket.ts#L375-L376", + "specLocation": "_types/aggregations/bucket.ts#L377-L378", "type": { "items": [ { @@ -48145,7 +48190,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L381-L384" + "specLocation": "_types/aggregations/bucket.ts#L383-L386" }, { "kind": "interface", @@ -48814,7 +48859,7 @@ } } ], - "specLocation": "_types/aggregations/bucket.ts#L386-L391" + "specLocation": "_types/aggregations/bucket.ts#L388-L393" }, { "attachedBehaviors": [ @@ -49161,7 +49206,7 @@ }, { "name": "preserve_original", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -49710,7 +49755,7 @@ }, { "name": "delimiter", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -49721,7 +49766,7 @@ }, { "name": "encoding", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -49825,7 +49870,7 @@ }, { "name": "max_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -49836,7 +49881,7 @@ }, { "name": "min_gram", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -49964,7 +50009,7 @@ }, { "name": "articles", - "required": true, + "required": false, "type": { "kind": "array_of", "value": { @@ -49976,9 +50021,20 @@ } } }, + { + "name": "articles_path", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, { "name": "articles_case", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -49988,7 +50044,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L186-L190" + "specLocation": "_types/analysis/token_filters.ts#L186-L191" }, { "kind": "interface", @@ -50097,7 +50153,7 @@ }, { "name": "max_output_size", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -50108,7 +50164,7 @@ }, { "name": "separator", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -50118,7 +50174,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L192-L196" + "specLocation": "_types/analysis/token_filters.ts#L193-L197" }, { "inherits": { @@ -50167,7 +50223,7 @@ }, { "name": "dedup", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -50178,7 +50234,7 @@ }, { "name": "dictionary", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -50200,7 +50256,7 @@ }, { "name": "longest_only", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -50210,7 +50266,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L198-L204" + "specLocation": "_types/analysis/token_filters.ts#L199-L205" }, { "inherits": { @@ -50764,7 +50820,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L237-L239" + "specLocation": "_types/analysis/token_filters.ts#L238-L240" }, { "kind": "enum", @@ -50780,7 +50836,7 @@ "name": "KeepTypesMode", "namespace": "_types.analysis" }, - "specLocation": "_types/analysis/token_filters.ts#L211-L214" + "specLocation": "_types/analysis/token_filters.ts#L212-L215" }, { "inherits": { @@ -50829,7 +50885,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L216-L220" + "specLocation": "_types/analysis/token_filters.ts#L217-L221" }, { "inherits": { @@ -50889,7 +50945,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L222-L227" + "specLocation": "_types/analysis/token_filters.ts#L223-L228" }, { "kind": "interface", @@ -50989,7 +51045,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L229-L235" + "specLocation": "_types/analysis/token_filters.ts#L230-L236" }, { "inherits": { @@ -51554,7 +51610,7 @@ }, { "name": "max", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -51565,7 +51621,7 @@ }, { "name": "min", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -51575,7 +51631,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L241-L245" + "specLocation": "_types/analysis/token_filters.ts#L242-L246" }, { "inherits": { @@ -51624,7 +51680,7 @@ }, { "name": "consume_all_tokens", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -51635,7 +51691,7 @@ }, { "name": "max_token_count", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -51645,7 +51701,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L247-L251" + "specLocation": "_types/analysis/token_filters.ts#L248-L252" }, { "kind": "interface", @@ -51698,7 +51754,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L253-L256" + "specLocation": "_types/analysis/token_filters.ts#L254-L257" }, { "inherits": { @@ -51810,7 +51866,7 @@ }, { "name": "preserve_original", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -51820,7 +51876,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L258-L262" + "specLocation": "_types/analysis/token_filters.ts#L259-L263" }, { "inherits": { @@ -51877,7 +51933,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L264-L269" + "specLocation": "_types/analysis/token_filters.ts#L265-L270" }, { "inherits": { @@ -52057,7 +52113,7 @@ }, { "name": "stoptags", - "required": true, + "required": false, "type": { "kind": "array_of", "value": { @@ -52070,7 +52126,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L271-L274" + "specLocation": "_types/analysis/token_filters.ts#L272-L275" }, { "inherits": { @@ -52364,7 +52420,7 @@ }, { "name": "preserve_original", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -52374,7 +52430,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L276-L280" + "specLocation": "_types/analysis/token_filters.ts#L277-L281" }, { "inherits": { @@ -52454,9 +52510,20 @@ "value": "pattern_replace" } }, + { + "name": "all", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, { "name": "flags", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -52478,7 +52545,7 @@ }, { "name": "replacement", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -52488,7 +52555,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L282-L287" + "specLocation": "_types/analysis/token_filters.ts#L283-L289" }, { "inherits": { @@ -52789,7 +52856,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L289-L291" + "specLocation": "_types/analysis/token_filters.ts#L291-L293" }, { "inherits": { @@ -52824,7 +52891,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L293-L296" + "specLocation": "_types/analysis/token_filters.ts#L295-L298" }, { "inherits": { @@ -52848,7 +52915,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L298-L300" + "specLocation": "_types/analysis/token_filters.ts#L300-L302" }, { "inherits": { @@ -52872,7 +52939,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L302-L304" + "specLocation": "_types/analysis/token_filters.ts#L304-L306" }, { "inherits": { @@ -53177,7 +53244,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L306-L309" + "specLocation": "_types/analysis/token_filters.ts#L308-L311" }, { "kind": "interface", @@ -53301,7 +53368,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L311-L315" + "specLocation": "_types/analysis/token_filters.ts#L313-L317" }, { "inherits": { @@ -53336,7 +53403,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L317-L320" + "specLocation": "_types/analysis/token_filters.ts#L319-L322" }, { "kind": "interface", @@ -53434,7 +53501,7 @@ }, { "name": "stopwords", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -53750,7 +53817,7 @@ "name": "TokenFilter", "namespace": "_types.analysis" }, - "specLocation": "_types/analysis/token_filters.ts#L340-L342", + "specLocation": "_types/analysis/token_filters.ts#L342-L344", "type": { "items": [ { @@ -53798,7 +53865,7 @@ "name": "TokenFilterDefinition", "namespace": "_types.analysis" }, - "specLocation": "_types/analysis/token_filters.ts#L344-L397", + "specLocation": "_types/analysis/token_filters.ts#L346-L399", "type": { "items": [ { @@ -54336,7 +54403,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L322-L324" + "specLocation": "_types/analysis/token_filters.ts#L324-L326" }, { "inherits": { @@ -54361,7 +54428,7 @@ }, { "name": "length", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -54371,7 +54438,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L326-L329" + "specLocation": "_types/analysis/token_filters.ts#L328-L331" }, { "inherits": { @@ -54441,7 +54508,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L331-L334" + "specLocation": "_types/analysis/token_filters.ts#L333-L336" }, { "inherits": { @@ -54465,7 +54532,7 @@ } } ], - "specLocation": "_types/analysis/token_filters.ts#L336-L338" + "specLocation": "_types/analysis/token_filters.ts#L338-L340" }, { "kind": "interface", @@ -94420,7 +94487,7 @@ "name": "IndexCheckOnStartup", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L310-L317" + "specLocation": "indices/_types/IndexSettings.ts#L324-L331" }, { "kind": "interface", @@ -94833,9 +94900,32 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L302-L308" + "specLocation": "indices/_types/IndexSettings.ts#L316-L322" }, { + "attachedBehaviors": [ + "AdditionalProperties" + ], + "behaviors": [ + { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + { + "kind": "user_defined_value" + } + ], + "type": { + "name": "AdditionalProperties", + "namespace": "_spec_utils" + } + } + ], "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/7.17/index-modules.html#index-modules-settings", "kind": "interface", "name": { @@ -95703,7 +95793,7 @@ }, { "description": "Enable or disable dynamic mapping for an index.", - "name": "mappings", + "name": "mapping", "required": false, "type": { "kind": "instance_of", @@ -95749,7 +95839,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L57-L300" + "specLocation": "indices/_types/IndexSettings.ts#L69-L314" }, { "kind": "interface", @@ -95869,7 +95959,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L366-L372" + "specLocation": "indices/_types/IndexSettings.ts#L380-L386" }, { "kind": "interface", @@ -95953,7 +96043,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L323-L356" + "specLocation": "indices/_types/IndexSettings.ts#L337-L370" }, { "kind": "interface", @@ -95975,7 +96065,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L358-L364" + "specLocation": "indices/_types/IndexSettings.ts#L372-L378" }, { "kind": "interface", @@ -96073,7 +96163,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L319-L321" + "specLocation": "indices/_types/IndexSettings.ts#L333-L335" }, { "kind": "interface", @@ -96094,7 +96184,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L570-L572" + "specLocation": "indices/_types/IndexSettings.ts#L584-L586" }, { "kind": "interface", @@ -96116,7 +96206,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L574-L581" + "specLocation": "indices/_types/IndexSettings.ts#L588-L595" }, { "description": "Mapping Limit Settings", @@ -96205,7 +96295,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L436-L448" + "specLocation": "indices/_types/IndexSettings.ts#L450-L462" }, { "kind": "interface", @@ -96228,7 +96318,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L460-L467" + "specLocation": "indices/_types/IndexSettings.ts#L474-L481" }, { "kind": "interface", @@ -96250,7 +96340,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L497-L503" + "specLocation": "indices/_types/IndexSettings.ts#L511-L517" }, { "kind": "interface", @@ -96272,7 +96362,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L488-L495" + "specLocation": "indices/_types/IndexSettings.ts#L502-L509" }, { "kind": "interface", @@ -96295,7 +96385,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L469-L477" + "specLocation": "indices/_types/IndexSettings.ts#L483-L491" }, { "kind": "interface", @@ -96318,7 +96408,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L479-L486" + "specLocation": "indices/_types/IndexSettings.ts#L493-L500" }, { "kind": "interface", @@ -96341,7 +96431,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L450-L458" + "specLocation": "indices/_types/IndexSettings.ts#L464-L472" }, { "kind": "interface", @@ -96434,7 +96524,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L53-L55" + "specLocation": "indices/_types/IndexSettings.ts#L65-L67" }, { "kind": "enum", @@ -96538,7 +96628,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L505-L510" + "specLocation": "indices/_types/IndexSettings.ts#L519-L524" }, { "kind": "interface", @@ -96592,7 +96682,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L523-L528" + "specLocation": "indices/_types/IndexSettings.ts#L537-L542" }, { "kind": "interface", @@ -96637,7 +96727,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L512-L521" + "specLocation": "indices/_types/IndexSettings.ts#L526-L535" }, { "kind": "interface", @@ -96672,7 +96762,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L38-L51" + "specLocation": "indices/_types/IndexSettings.ts#L50-L63" }, { "kind": "interface", @@ -96705,7 +96795,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L530-L539" + "specLocation": "indices/_types/IndexSettings.ts#L544-L553" }, { "kind": "enum", @@ -96734,7 +96824,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L541-L568" + "specLocation": "indices/_types/IndexSettings.ts#L555-L582" }, { "kind": "interface", @@ -96891,7 +96981,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L374-L396" + "specLocation": "indices/_types/IndexSettings.ts#L388-L410" }, { "kind": "enum", @@ -96915,7 +97005,7 @@ "name": "TranslogDurability", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L398-L413" + "specLocation": "indices/_types/IndexSettings.ts#L412-L427" }, { "kind": "interface", @@ -96951,7 +97041,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L415-L434" + "specLocation": "indices/_types/IndexSettings.ts#L429-L448" }, { "kind": "enum", @@ -101070,7 +101160,7 @@ } }, "kind": "dictionary_of", - "singleKey": true, + "singleKey": false, "value": { "kind": "instance_of", "type": { @@ -103990,7 +104080,7 @@ }, { "name": "stop_time_in_millis", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -153950,9 +154040,31 @@ "body": { "kind": "properties", "properties": [ + { + "name": "aggregations", + "required": false, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "AggregationContainer", + "namespace": "_types.aggregations" + } + } + } + }, { "name": "size", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -153963,7 +154075,7 @@ }, { "name": "_source", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -153974,32 +154086,32 @@ }, { "name": "fields", - "required": true, + "required": false, "type": { "kind": "array_of", "value": { - "key": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" } } } }, + { + "name": "query", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "QueryContainer", + "namespace": "_types.query_dsl" + } + } + }, { "name": "sort", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -154015,7 +154127,7 @@ "name": "Response", "namespace": "sql.translate" }, - "specLocation": "sql/translate/TranslateSqlResponse.ts#L26-L33" + "specLocation": "sql/translate/TranslateSqlResponse.ts#L28-L38" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 277f14dbf7..d52bb30894 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2547,6 +2547,8 @@ export interface AggregationsAggregateBase { meta?: Record } +export type AggregationsAggregateOrder = Partial> | Partial>[] + export interface AggregationsAggregation { meta?: Record name?: string @@ -2793,7 +2795,7 @@ export interface AggregationsDateHistogramAggregation extends AggregationsBucket min_doc_count?: integer missing?: DateString offset?: Time - order?: AggregationsHistogramOrder + order?: AggregationsAggregateOrder params?: Record script?: Script time_zone?: string @@ -3040,7 +3042,7 @@ export interface AggregationsHistogramAggregation extends AggregationsBucketAggr min_doc_count?: integer missing?: double offset?: double - order?: AggregationsHistogramOrder + order?: AggregationsAggregateOrder script?: Script format?: string keyed?: boolean @@ -3053,11 +3055,6 @@ export interface AggregationsHistogramBucketKeys extends AggregationsMultiBucket export type AggregationsHistogramBucket = AggregationsHistogramBucketKeys & { [property: string]: AggregationsAggregate | string | double | long } -export interface AggregationsHistogramOrder { - _count?: SortOrder - _key?: SortOrder -} - export interface AggregationsHoltLinearModelSettings { alpha?: float beta?: float @@ -3276,6 +3273,13 @@ export interface AggregationsMultiTermsAggregate extends AggregationsTermsAggreg } export interface AggregationsMultiTermsAggregation extends AggregationsBucketAggregationBase { + collect_mode?: AggregationsTermsAggregationCollectMode + order?: AggregationsAggregateOrder + min_doc_count?: long + shard_min_doc_count?: long + shard_size?: integer + show_term_doc_count_error?: boolean + size?: integer terms: AggregationsMultiTermLookup[] } @@ -3639,7 +3643,7 @@ export interface AggregationsTermsAggregation extends AggregationsBucketAggregat missing_order?: AggregationsMissingOrder missing_bucket?: boolean value_type?: string - order?: AggregationsTermsAggregationOrder + order?: AggregationsAggregateOrder script?: Script shard_size?: integer show_term_doc_count_error?: boolean @@ -3650,8 +3654,6 @@ export type AggregationsTermsAggregationCollectMode = 'depth_first' | 'breadth_f export type AggregationsTermsAggregationExecutionHint = 'map' | 'global_ordinals' | 'global_ordinals_hash' | 'global_ordinals_low_cardinality' -export type AggregationsTermsAggregationOrder = Record | Record[] - export interface AggregationsTermsBucketBase extends AggregationsMultiBucketBase { doc_count_error?: long } @@ -3772,7 +3774,7 @@ export type AnalysisAnalyzer = AnalysisCustomAnalyzer | AnalysisFingerprintAnaly export interface AnalysisAsciiFoldingTokenFilter extends AnalysisTokenFilterBase { type: 'asciifolding' - preserve_original: boolean + preserve_original?: boolean } export type AnalysisCharFilter = string | AnalysisCharFilterDefinition @@ -3832,8 +3834,8 @@ export type AnalysisDelimitedPayloadEncoding = 'int' | 'float' | 'identity' export interface AnalysisDelimitedPayloadTokenFilter extends AnalysisTokenFilterBase { type: 'delimited_payload' - delimiter: string - encoding: AnalysisDelimitedPayloadEncoding + delimiter?: string + encoding?: AnalysisDelimitedPayloadEncoding } export interface AnalysisDictionaryDecompounderTokenFilter extends AnalysisCompoundWordTokenFilterBase { @@ -3849,8 +3851,8 @@ export type AnalysisEdgeNGramSide = 'front' | 'back' export interface AnalysisEdgeNGramTokenFilter extends AnalysisTokenFilterBase { type: 'edge_ngram' - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer side?: AnalysisEdgeNGramSide preserve_original?: boolean } @@ -3865,8 +3867,9 @@ export interface AnalysisEdgeNGramTokenizer extends AnalysisTokenizerBase { export interface AnalysisElisionTokenFilter extends AnalysisTokenFilterBase { type: 'elision' - articles: string[] - articles_case: boolean + articles?: string[] + articles_path?: string + articles_case?: boolean } export interface AnalysisFingerprintAnalyzer { @@ -3881,8 +3884,8 @@ export interface AnalysisFingerprintAnalyzer { export interface AnalysisFingerprintTokenFilter extends AnalysisTokenFilterBase { type: 'fingerprint' - max_output_size: integer - separator: string + max_output_size?: integer + separator?: string } export interface AnalysisHtmlStripCharFilter extends AnalysisCharFilterBase { @@ -3891,10 +3894,10 @@ export interface AnalysisHtmlStripCharFilter extends AnalysisCharFilterBase { export interface AnalysisHunspellTokenFilter extends AnalysisTokenFilterBase { type: 'hunspell' - dedup: boolean - dictionary: string + dedup?: boolean + dictionary?: string locale: string - longest_only: boolean + longest_only?: boolean } export interface AnalysisHyphenationDecompounderTokenFilter extends AnalysisCompoundWordTokenFilterBase { @@ -4053,8 +4056,8 @@ export interface AnalysisLanguageAnalyzer { export interface AnalysisLengthTokenFilter extends AnalysisTokenFilterBase { type: 'length' - max: integer - min: integer + max?: integer + min?: integer } export interface AnalysisLetterTokenizer extends AnalysisTokenizerBase { @@ -4063,8 +4066,8 @@ export interface AnalysisLetterTokenizer extends AnalysisTokenizerBase { export interface AnalysisLimitTokenCountTokenFilter extends AnalysisTokenFilterBase { type: 'limit' - consume_all_tokens: boolean - max_token_count: integer + consume_all_tokens?: boolean + max_token_count?: integer } export interface AnalysisLowercaseNormalizer { @@ -4089,7 +4092,7 @@ export interface AnalysisMappingCharFilter extends AnalysisCharFilterBase { export interface AnalysisMultiplexerTokenFilter extends AnalysisTokenFilterBase { type: 'multiplexer' filters: string[] - preserve_original: boolean + preserve_original?: boolean } export interface AnalysisNGramTokenFilter extends AnalysisTokenFilterBase { @@ -4119,7 +4122,7 @@ export type AnalysisNoriDecompoundMode = 'discard' | 'none' | 'mixed' export interface AnalysisNoriPartOfSpeechTokenFilter extends AnalysisTokenFilterBase { type: 'nori_part_of_speech' - stoptags: string[] + stoptags?: string[] } export interface AnalysisNoriTokenizer extends AnalysisTokenizerBase { @@ -4153,7 +4156,7 @@ export interface AnalysisPatternAnalyzer { export interface AnalysisPatternCaptureTokenFilter extends AnalysisTokenFilterBase { type: 'pattern_capture' patterns: string[] - preserve_original: boolean + preserve_original?: boolean } export interface AnalysisPatternReplaceCharFilter extends AnalysisCharFilterBase { @@ -4165,9 +4168,10 @@ export interface AnalysisPatternReplaceCharFilter extends AnalysisCharFilterBase export interface AnalysisPatternReplaceTokenFilter extends AnalysisTokenFilterBase { type: 'pattern_replace' - flags: string + all?: boolean + flags?: string pattern: string - replacement: string + replacement?: string } export interface AnalysisPatternTokenizer extends AnalysisTokenizerBase { @@ -4274,7 +4278,7 @@ export interface AnalysisStopTokenFilter extends AnalysisTokenFilterBase { type: 'stop' ignore_case?: boolean remove_trailing?: boolean - stopwords: AnalysisStopWords + stopwords?: AnalysisStopWords stopwords_path?: string } @@ -4328,7 +4332,7 @@ export interface AnalysisTrimTokenFilter extends AnalysisTokenFilterBase { export interface AnalysisTruncateTokenFilter extends AnalysisTokenFilterBase { type: 'truncate' - length: integer + length?: integer } export interface AnalysisUaxEmailUrlTokenizer extends AnalysisTokenizerBase { @@ -9051,118 +9055,69 @@ export interface IndicesIndexSettingBlocks { metadata?: boolean } -export interface IndicesIndexSettings { +export interface IndicesIndexSettingsKeys { index?: IndicesIndexSettings mode?: string - 'index.mode'?: string routing_path?: string[] - 'index.routing_path'?: string[] soft_deletes?: IndicesSoftDeletes - 'index.soft_deletes'?: IndicesSoftDeletes sort?: IndicesIndexSegmentSort - 'index.sort'?: IndicesIndexSegmentSort number_of_shards?: integer | string - 'index.number_of_shards'?: integer | string number_of_replicas?: integer | string - 'index.number_of_replicas'?: integer | string number_of_routing_shards?: integer - 'index.number_of_routing_shards'?: integer check_on_startup?: IndicesIndexCheckOnStartup - 'index.check_on_startup'?: IndicesIndexCheckOnStartup codec?: string - 'index.codec'?: string routing_partition_size?: integer - 'index.routing_partition_size'?: integer 'soft_deletes.retention_lease.period'?: Time - 'index.soft_deletes.retention_lease.period'?: Time load_fixed_bitset_filters_eagerly?: boolean - 'index.load_fixed_bitset_filters_eagerly'?: boolean hidden?: boolean | string - 'index.hidden'?: boolean | string auto_expand_replicas?: string - 'index.auto_expand_replicas'?: string 'merge.scheduler.max_thread_count'?: integer - 'index.merge.scheduler.max_thread_count'?: integer 'search.idle.after'?: Time - 'index.search.idle.after'?: Time refresh_interval?: Time - 'index.refresh_interval'?: Time max_result_window?: integer - 'index.max_result_window'?: integer max_inner_result_window?: integer - 'index.max_inner_result_window'?: integer max_rescore_window?: integer - 'index.max_rescore_window'?: integer max_docvalue_fields_search?: integer - 'index.max_docvalue_fields_search'?: integer max_script_fields?: integer - 'index.max_script_fields'?: integer max_ngram_diff?: integer - 'index.max_ngram_diff'?: integer max_shingle_diff?: integer - 'index.max_shingle_diff'?: integer blocks?: IndicesIndexSettingBlocks - 'index.blocks'?: IndicesIndexSettingBlocks 'blocks.read_only'?: boolean - 'index.blocks.read_only'?: boolean 'blocks.read_only_allow_delete'?: boolean - 'index.blocks.read_only_allow_delete'?: boolean 'blocks.read'?: boolean - 'index.blocks.read'?: boolean 'blocks.write'?: boolean | string - 'index.blocks.write'?: boolean | string 'blocks.metadata'?: boolean - 'index.blocks.metadata'?: boolean max_refresh_listeners?: integer - 'index.max_refresh_listeners'?: integer 'analyze.max_token_count'?: integer - 'index.analyze.max_token_count'?: integer 'highlight.max_analyzed_offset'?: integer - 'index.highlight.max_analyzed_offset'?: integer max_terms_count?: integer - 'index.max_terms_count'?: integer max_regex_length?: integer - 'index.max_regex_length'?: integer routing?: IndicesIndexRouting - 'index.routing'?: IndicesIndexRouting gc_deletes?: Time - 'index.gc_deletes'?: Time default_pipeline?: PipelineName - 'index.default_pipeline'?: PipelineName final_pipeline?: PipelineName - 'index.final_pipeline'?: PipelineName lifecycle?: IndicesIndexSettingsLifecycle - 'index.lifecycle'?: IndicesIndexSettingsLifecycle 'lifecycle.name'?: string - 'index.lifecycle.name'?: string provided_name?: Name - 'index.provided_name'?: Name creation_date?: DateString - 'index.creation_date'?: DateString uuid?: Uuid - 'index.uuid'?: Uuid version?: IndicesIndexVersioning - 'index.version'?: IndicesIndexVersioning verified_before_close?: boolean - 'index.verified_before_close'?: boolean format?: string | integer - 'index.format'?: string | integer max_slices_per_scroll?: integer - 'index.max_slices_per_scroll'?: integer translog?: IndicesTranslog 'query_string.lenient'?: boolean - 'index.query_string.lenient'?: boolean priority?: integer | string - 'index.priority'?: integer | string top_metrics_max_size?: integer analysis?: IndicesIndexSettingsAnalysis - 'index.analysis'?: IndicesIndexSettingsAnalysis settings?: IndicesIndexSettings - mappings?: IndicesMappingLimitSettings + mapping?: IndicesMappingLimitSettings 'indexing.slowlog'?: IndicesSlowlogSettings indexing_pressure?: IndicesIndexingPressure store?: IndicesStorage } +export type IndicesIndexSettings = IndicesIndexSettingsKeys + & { [property: string]: any } export interface IndicesIndexSettingsAnalysis { analyzer?: Record @@ -9748,7 +9703,7 @@ export interface IndicesGetFieldMappingResponse extends DictionaryResponseBase> + mappings: Record } export interface IndicesGetIndexTemplateIndexTemplate { @@ -10050,7 +10005,7 @@ export interface IndicesRecoveryShardRecovery { start_time?: DateString start_time_in_millis: EpochMillis stop_time?: DateString - stop_time_in_millis: EpochMillis + stop_time_in_millis?: EpochMillis target: IndicesRecoveryRecoveryOrigin total_time?: DateString total_time_in_millis: EpochMillis @@ -15583,10 +15538,12 @@ export interface SqlTranslateRequest extends RequestBase { } export interface SqlTranslateResponse { - size: long - _source: SearchSourceConfig - fields: Record[] - sort: Sort + aggregations?: Record + size?: long + _source?: SearchSourceConfig + fields?: (QueryDslFieldAndFormat | Field)[] + query?: QueryDslQueryContainer + sort?: Sort } export interface SslCertificatesCertificateInformation { diff --git a/specification/_spec_utils/Stringified.ts b/specification/_spec_utils/Stringified.ts new file mode 100644 index 0000000000..c0917b06f3 --- /dev/null +++ b/specification/_spec_utils/Stringified.ts @@ -0,0 +1,27 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior + * is used to capture this behavior while keeping the semantics of the field type. + * + * Depending on the target language, code generators can keep the union or remove it and leniently parse + * strings to the target type. + */ +export type Stringified = T | string diff --git a/specification/_types/aggregations/bucket.ts b/specification/_types/aggregations/bucket.ts index 53f3dcde84..567867d29d 100644 --- a/specification/_types/aggregations/bucket.ts +++ b/specification/_types/aggregations/bucket.ts @@ -18,7 +18,7 @@ */ import { SortOrder } from '@_types/sort' -import { Dictionary } from '@spec_utils/Dictionary' +import { Dictionary, SingleKeyDictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { Field, RelationName, Fields } from '@_types/common' import { @@ -97,7 +97,7 @@ export class DateHistogramAggregation extends BucketAggregationBase { min_doc_count?: integer missing?: DateString offset?: Time - order?: HistogramOrder + order?: AggregateOrder params?: Dictionary script?: Script time_zone?: string @@ -207,17 +207,12 @@ export class HistogramAggregation extends BucketAggregationBase { min_doc_count?: integer missing?: double offset?: double - order?: HistogramOrder + order?: AggregateOrder script?: Script format?: string keyed?: boolean } -export class HistogramOrder { - _count?: SortOrder - _key?: SortOrder -} - export class IpRangeAggregation extends BucketAggregationBase { field?: Field ranges?: IpRangeAggregationRange[] @@ -235,6 +230,13 @@ export class MissingAggregation extends BucketAggregationBase { } export class MultiTermsAggregation extends BucketAggregationBase { + collect_mode?: TermsAggregationCollectMode + order?: AggregateOrder + min_doc_count?: long + shard_min_doc_count?: long + shard_size?: integer + show_term_doc_count_error?: boolean + size?: integer terms: MultiTermLookup[] } @@ -349,16 +351,16 @@ export class TermsAggregation extends BucketAggregationBase { missing_order?: MissingOrder missing_bucket?: boolean value_type?: string - order?: TermsAggregationOrder + order?: AggregateOrder script?: Script shard_size?: integer show_term_doc_count_error?: boolean size?: integer } -export type TermsAggregationOrder = - | Dictionary - | Dictionary[] +export type AggregateOrder = + | SingleKeyDictionary + | SingleKeyDictionary[] export enum TermsAggregationCollectMode { depth_first = 0, diff --git a/specification/_types/analysis/token_filters.ts b/specification/_types/analysis/token_filters.ts index b03c357aba..d7d621e17b 100644 --- a/specification/_types/analysis/token_filters.ts +++ b/specification/_types/analysis/token_filters.ts @@ -66,8 +66,8 @@ export enum DelimitedPayloadEncoding { export class DelimitedPayloadTokenFilter extends TokenFilterBase { type: 'delimited_payload' - delimiter: string - encoding: DelimitedPayloadEncoding + delimiter?: string + encoding?: DelimitedPayloadEncoding } export enum EdgeNGramSide { @@ -77,8 +77,8 @@ export enum EdgeNGramSide { export class EdgeNGramTokenFilter extends TokenFilterBase { type: 'edge_ngram' - max_gram: integer - min_gram: integer + max_gram?: integer + min_gram?: integer side?: EdgeNGramSide preserve_original?: boolean } @@ -97,7 +97,7 @@ export class StopTokenFilter extends TokenFilterBase { type: 'stop' ignore_case?: boolean remove_trailing?: boolean - stopwords: StopWords + stopwords?: StopWords stopwords_path?: string } @@ -166,7 +166,7 @@ export class WordDelimiterGraphTokenFilter extends TokenFilterBase { export class AsciiFoldingTokenFilter extends TokenFilterBase { type: 'asciifolding' - preserve_original: boolean + preserve_original?: boolean } export class CommonGramsTokenFilter extends TokenFilterBase { @@ -185,27 +185,28 @@ export class ConditionTokenFilter extends TokenFilterBase { export class ElisionTokenFilter extends TokenFilterBase { type: 'elision' - articles: string[] - articles_case: boolean + articles?: string[] + articles_path?: string + articles_case?: boolean } export class FingerprintTokenFilter extends TokenFilterBase { type: 'fingerprint' - max_output_size: integer - separator: string + max_output_size?: integer + separator?: string } export class HunspellTokenFilter extends TokenFilterBase { type: 'hunspell' - dedup: boolean - dictionary: string + dedup?: boolean + dictionary?: string locale: string - longest_only: boolean + longest_only?: boolean } export class JaStopTokenFilter extends TokenFilterBase { type: 'ja_stop' - stopwords: StopWords + stopwords?: StopWords } export enum KeepTypesMode { @@ -240,14 +241,14 @@ export class KStemTokenFilter extends TokenFilterBase { export class LengthTokenFilter extends TokenFilterBase { type: 'length' - max: integer - min: integer + max?: integer + min?: integer } export class LimitTokenCountTokenFilter extends TokenFilterBase { type: 'limit' - consume_all_tokens: boolean - max_token_count: integer + consume_all_tokens?: boolean + max_token_count?: integer } export class LowercaseTokenFilter extends TokenFilterBase { @@ -258,7 +259,7 @@ export class LowercaseTokenFilter extends TokenFilterBase { export class MultiplexerTokenFilter extends TokenFilterBase { type: 'multiplexer' filters: string[] - preserve_original: boolean + preserve_original?: boolean } export class NGramTokenFilter extends TokenFilterBase { @@ -270,20 +271,21 @@ export class NGramTokenFilter extends TokenFilterBase { export class NoriPartOfSpeechTokenFilter extends TokenFilterBase { type: 'nori_part_of_speech' - stoptags: string[] + stoptags?: string[] } export class PatternCaptureTokenFilter extends TokenFilterBase { type: 'pattern_capture' patterns: string[] - preserve_original: boolean + preserve_original?: boolean } export class PatternReplaceTokenFilter extends TokenFilterBase { type: 'pattern_replace' - flags: string + all?: boolean + flags?: string pattern: string - replacement: string + replacement?: string } export class PorterStemTokenFilter extends TokenFilterBase { @@ -325,7 +327,7 @@ export class TrimTokenFilter extends TokenFilterBase { export class TruncateTokenFilter extends TokenFilterBase { type: 'truncate' - length: integer + length?: integer } export class UniqueTokenFilter extends TokenFilterBase { diff --git a/specification/indices/_types/IndexSettings.ts b/specification/indices/_types/IndexSettings.ts index fc05a9556b..d4205b2054 100644 --- a/specification/indices/_types/IndexSettings.ts +++ b/specification/indices/_types/IndexSettings.ts @@ -34,6 +34,18 @@ import { integer, long } from '@_types/Numeric' import { DateString, Time } from '@_types/Time' import { Tokenizer } from '@_types/analysis/tokenizers' import { IndexSegmentSort } from './IndexSegmentSort' +import { + DFIIndependenceMeasure, + DFRAfterEffect, + DFRBasicModel, + IBDistribution, + IBLambda, + Normalization +} from '@_types/Similarity' +import { Script } from '@_types/Scripting' +import { Stringified } from '@spec_utils/Stringified' +import { AdditionalProperties } from '@spec_utils/behaviors' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' export class SoftDeletes { /** @@ -57,7 +69,9 @@ export class RetentionLease { /** * @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/7.17/index-modules.html#index-modules-settings */ -export class IndexSettings { +export class IndexSettings + implements AdditionalProperties +{ index?: IndexSettings /** * @aliases index.mode @@ -287,7 +301,7 @@ export class IndexSettings { /** * Enable or disable dynamic mapping for an index. */ - mappings?: MappingLimitSettings + mapping?: MappingLimitSettings 'indexing.slowlog'?: SlowlogSettings /** * Configure indexing back pressure limits. diff --git a/specification/indices/get_field_mapping/types.ts b/specification/indices/get_field_mapping/types.ts index 26b1f4206e..04b5916c8a 100644 --- a/specification/indices/get_field_mapping/types.ts +++ b/specification/indices/get_field_mapping/types.ts @@ -17,10 +17,10 @@ * under the License. */ -import { SingleKeyDictionary } from '@spec_utils/Dictionary' +import { Dictionary } from '@spec_utils/Dictionary' import { Field } from '@_types/common' import { FieldMapping } from '@_types/mapping/meta-fields' export class TypeFieldMappings { - mappings: SingleKeyDictionary + mappings: Dictionary } diff --git a/specification/indices/recovery/types.ts b/specification/indices/recovery/types.ts index 1a900a1a98..2388eb86a1 100644 --- a/specification/indices/recovery/types.ts +++ b/specification/indices/recovery/types.ts @@ -118,7 +118,7 @@ export class ShardRecovery { start_time?: DateString start_time_in_millis: EpochMillis stop_time?: DateString - stop_time_in_millis: EpochMillis + stop_time_in_millis?: EpochMillis target: RecoveryOrigin total_time?: DateString total_time_in_millis: EpochMillis diff --git a/specification/sql/translate/TranslateSqlResponse.ts b/specification/sql/translate/TranslateSqlResponse.ts index 7aa353c29a..24f376c555 100644 --- a/specification/sql/translate/TranslateSqlResponse.ts +++ b/specification/sql/translate/TranslateSqlResponse.ts @@ -22,12 +22,17 @@ import { SourceConfig } from '@global/search/_types/SourceFilter' import { Dictionary } from '@spec_utils/Dictionary' import { Field, Fields } from '@_types/common' import { long } from '@_types/Numeric' +import { FieldAndFormat, QueryContainer } from '@_types/query_dsl/abstractions' +import { AggregationContainer } from '@_types/aggregations/AggregationContainer' export class Response { + // This is a subset of SearchRequest's body (same data structure in the ES code) body: { - size: long - _source: SourceConfig - fields: Array> - sort: Sort + aggregations?: Dictionary + size?: long + _source?: SourceConfig + fields?: Array + query?: QueryContainer + sort?: Sort } }