diff --git a/compiler/src/model/utils.ts b/compiler/src/model/utils.ts index 53fd54a656..a6b254948a 100644 --- a/compiler/src/model/utils.ts +++ b/compiler/src/model/utils.ts @@ -301,6 +301,7 @@ export function modelType (node: Node): model.ValueOf { const generics = node.getTypeArguments().map(node => modelType(node)) const identifier = node.getTypeName() assert(node, Node.isIdentifier(identifier), 'Not an identifier') + assert(node, identifier.getDefinitions().length > 0, 'Unknown definition (missing import?)') const declaration = identifier.getDefinitions()[0].getDeclarationNode() // We are looking at a generic parameter diff --git a/output/schema/schema.json b/output/schema/schema.json index d0a4534220..12a8c5a979 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -15715,7 +15715,7 @@ "type": { "kind": "instance_of", "type": { - "name": "long", + "name": "Slices", "namespace": "_types" } } @@ -15811,7 +15811,7 @@ } } ], - "specLocation": "_global/delete_by_query/DeleteByQueryRequest.ts#L35-L80" + "specLocation": "_global/delete_by_query/DeleteByQueryRequest.ts#L36-L81" }, { "body": { @@ -19181,7 +19181,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L171-L174" + "specLocation": "_global/msearch/types.ts#L202-L205" }, { "generics": [ @@ -19231,7 +19231,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L161-L164" + "specLocation": "_global/msearch/types.ts#L192-L195" }, { "kind": "interface", @@ -19265,6 +19265,17 @@ } } }, + { + "name": "collapse", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "FieldCollapse", + "namespace": "_global.search._types" + } + } + }, { "description": "Defines the search definition using the Query DSL.", "name": "query", @@ -19330,6 +19341,137 @@ } } }, + { + "name": "highlight", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Highlight", + "namespace": "_global.search._types" + } + } + }, + { + "description": "Boosts the _score of documents from specified indices.", + "name": "indices_boost", + "required": false, + "type": { + "kind": "array_of", + "value": { + "key": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + } + } + }, + { + "description": "Minimum _score for matching documents. Documents with a lower _score are\nnot included in the search results.", + "name": "min_score", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + }, + { + "name": "post_filter", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "QueryContainer", + "namespace": "_types.query_dsl" + } + } + }, + { + "name": "profile", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "rescore", + "required": false, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "Rescore", + "namespace": "_global.search._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Rescore", + "namespace": "_global.search._types" + } + } + } + ], + "kind": "union_of" + } + }, + { + "description": "Retrieve a script evaluation (based on different fields) for each hit.", + "name": "script_fields", + "required": false, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "ScriptField", + "namespace": "_types" + } + } + } + }, + { + "name": "search_after", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "SortResults", + "namespace": "_types" + } + } + }, { "description": "The number of hits to return. By default, you cannot page through more\nthan 10,000 hits using the from and size parameters. To page through more\nhits, use the search_after parameter.", "name": "size", @@ -19368,6 +19510,21 @@ } } }, + { + "description": "Array of wildcard (*) patterns. The request returns values for field names\nmatching these patterns in the hits.fields property of the response.", + "name": "fields", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" + } + } + } + }, { "description": "Maximum number of documents to collect for each shard. If a query reaches this\nlimit, Elasticsearch terminates the query early. Elasticsearch collects documents\nbefore sorting. Defaults to 0, which does not terminate query execution early.", "name": "terminate_after", @@ -19446,6 +19603,18 @@ } } }, + { + "description": "Defines one or more runtime fields in the search request. These fields take\nprecedence over mapped fields with the same name.", + "name": "runtime_mappings", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "RuntimeFields", + "namespace": "_types.mapping" + } + } + }, { "description": "If true, returns sequence number and primary term of the last modification\nof each hit. See Optimistic concurrency control.", "name": "seq_no_primary_term", @@ -19482,7 +19651,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L67-L159" + "specLocation": "_global/msearch/types.ts#L69-L190" }, { "description": "Contains parameters used to limit or change the subsequent search body request.", @@ -19564,8 +19733,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "Routing", + "namespace": "_types" } } }, @@ -19614,7 +19783,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L50-L65" + "specLocation": "_global/msearch/types.ts#L51-L66" }, { "attachedBehaviors": [ @@ -19764,27 +19933,39 @@ } }, { - "description": "Indicates whether global term and document frequencies should be used when scoring returned documents.", - "name": "search_type", + "description": "If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.", + "name": "rest_total_hits_as_int", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { - "name": "SearchType", + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "Custom routing value used to route search operations to a specific shard.", + "name": "routing", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Routing", "namespace": "_types" } } }, { - "description": "If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.", - "name": "rest_total_hits_as_int", + "description": "Indicates whether global term and document frequencies should be used when scoring returned documents.", + "name": "search_type", "required": false, - "serverDefault": false, "type": { "kind": "instance_of", "type": { - "name": "boolean", - "namespace": "_builtins" + "name": "SearchType", + "namespace": "_types" } } }, @@ -19801,7 +19982,7 @@ } } ], - "specLocation": "_global/msearch/MultiSearchRequest.ts#L25-L92" + "specLocation": "_global/msearch/MultiSearchRequest.ts#L25-L96" }, { "codegenNames": [ @@ -19813,7 +19994,7 @@ "name": "RequestItem", "namespace": "_global.msearch" }, - "specLocation": "_global/msearch/types.ts#L45-L48", + "specLocation": "_global/msearch/types.ts#L46-L49", "type": { "items": [ { @@ -19883,7 +20064,7 @@ "name": "ResponseItem", "namespace": "_global.msearch" }, - "specLocation": "_global/msearch/types.ts#L166-L169", + "specLocation": "_global/msearch/types.ts#L197-L200", "type": { "items": [ { @@ -21725,7 +21906,7 @@ } } ], - "specLocation": "_global/reindex/types.ts#L38-L44" + "specLocation": "_global/reindex/types.ts#L39-L45" }, { "kind": "interface", @@ -21736,7 +21917,7 @@ "properties": [ { "name": "connect_timeout", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -21745,6 +21926,28 @@ } } }, + { + "name": "headers", + "required": false, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, { "name": "host", "required": true, @@ -21758,7 +21961,7 @@ }, { "name": "username", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -21769,7 +21972,7 @@ }, { "name": "password", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -21780,7 +21983,7 @@ }, { "name": "socket_timeout", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -21790,7 +21993,7 @@ } } ], - "specLocation": "_global/reindex/types.ts#L58-L64" + "specLocation": "_global/reindex/types.ts#L59-L66" }, { "attachedBehaviors": [ @@ -21924,7 +22127,7 @@ "type": { "kind": "instance_of", "type": { - "name": "long", + "name": "Slices", "namespace": "_types" } } @@ -22268,7 +22471,7 @@ } } ], - "specLocation": "_global/reindex/types.ts#L46-L56" + "specLocation": "_global/reindex/types.ts#L47-L57" }, { "inherits": { @@ -24018,7 +24221,7 @@ } } ], - "specLocation": "_global/search/SearchRequest.ts#L50-L233" + "specLocation": "_global/search/SearchRequest.ts#L50-L234" }, { "body": { @@ -24867,7 +25070,7 @@ "name": "BoundaryScanner", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/highlighting.ts#L25-L29" + "specLocation": "_global/search/_types/highlighting.ts#L26-L30" }, { "kind": "interface", @@ -25793,12 +25996,29 @@ } }, { + "inherits": { + "type": { + "name": "HighlightBase", + "namespace": "_global.search._types" + } + }, "kind": "interface", "name": { "name": "Highlight", "namespace": "_global.search._types" }, "properties": [ + { + "name": "encoder", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "HighlighterEncoder", + "namespace": "_global.search._types" + } + } + }, { "name": "fields", "required": true, @@ -25820,7 +26040,17 @@ } } } - }, + } + ], + "specLocation": "_global/search/_types/highlighting.ts#L56-L59" + }, + { + "kind": "interface", + "name": { + "name": "HighlightBase", + "namespace": "_global.search._types" + }, + "properties": [ { "name": "type", "required": false, @@ -25877,13 +26107,13 @@ } }, { - "name": "encoder", + "name": "force_source", "required": false, "type": { "kind": "instance_of", "type": { - "name": "HighlighterEncoder", - "namespace": "_global.search._types" + "name": "boolean", + "namespace": "_builtins" } } }, @@ -25899,7 +26129,7 @@ } }, { - "name": "fragment_offset", + "name": "fragment_size", "required": false, "type": { "kind": "instance_of", @@ -25910,7 +26140,29 @@ } }, { - "name": "fragment_size", + "name": "highlight_filter", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "highlight_query", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "QueryContainer", + "namespace": "_types.query_dsl" + } + } + }, + { + "name": "max_fragment_length", "required": false, "type": { "kind": "instance_of", @@ -25921,7 +26173,7 @@ } }, { - "name": "max_fragment_length", + "name": "max_analyzed_offset", "required": false, "type": { "kind": "instance_of", @@ -25954,261 +26206,20 @@ } }, { - "name": "order", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "HighlighterOrder", - "namespace": "_global.search._types" - } - } - }, - { - "name": "post_tags", + "name": "options", "required": false, "type": { - "kind": "array_of", - "value": { + "key": { "kind": "instance_of", "type": { "name": "string", "namespace": "_builtins" } - } - } - }, - { - "name": "pre_tags", - "required": false, - "type": { - "kind": "array_of", + }, + "kind": "dictionary_of", + "singleKey": false, "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - }, - { - "name": "require_field_match", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - }, - { - "name": "tags_schema", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "HighlighterTagsSchema", - "namespace": "_global.search._types" - } - } - }, - { - "name": "highlight_query", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "QueryContainer", - "namespace": "_types.query_dsl" - } - } - }, - { - "name": "max_analyzed_offset", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - ], - "kind": "union_of" - } - } - ], - "specLocation": "_global/search/_types/highlighting.ts#L31-L54" - }, - { - "kind": "interface", - "name": { - "name": "HighlightField", - "namespace": "_global.search._types" - }, - "properties": [ - { - "name": "boundary_chars", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "boundary_max_scan", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "name": "boundary_scanner", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "BoundaryScanner", - "namespace": "_global.search._types" - } - } - }, - { - "name": "boundary_scanner_locale", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "field", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - } - }, - { - "name": "force_source", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - }, - { - "name": "fragmenter", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "HighlighterFragmenter", - "namespace": "_global.search._types" - } - } - }, - { - "name": "fragment_offset", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "name": "fragment_size", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "name": "highlight_query", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "QueryContainer", - "namespace": "_types.query_dsl" - } - } - }, - { - "name": "matched_fields", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - }, - { - "name": "max_fragment_length", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "name": "no_match_size", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "name": "number_of_fragments", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" + "kind": "user_defined_value" } } }, @@ -26283,20 +26294,47 @@ "namespace": "_global.search._types" } } + } + ], + "specLocation": "_global/search/_types/highlighting.ts#L32-L54" + }, + { + "inherits": { + "type": { + "name": "HighlightBase", + "namespace": "_global.search._types" + } + }, + "kind": "interface", + "name": { + "name": "HighlightField", + "namespace": "_global.search._types" + }, + "properties": [ + { + "name": "fragment_offset", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } }, { - "name": "type", + "name": "matched_fields", "required": false, "type": { "kind": "instance_of", "type": { - "name": "HighlighterType", - "namespace": "_global.search._types" + "name": "Fields", + "namespace": "_types" } } } ], - "specLocation": "_global/search/_types/highlighting.ts#L82-L105" + "specLocation": "_global/search/_types/highlighting.ts#L87-L90" }, { "kind": "enum", @@ -26312,7 +26350,7 @@ "name": "HighlighterEncoder", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/highlighting.ts#L56-L59" + "specLocation": "_global/search/_types/highlighting.ts#L61-L64" }, { "kind": "enum", @@ -26328,7 +26366,7 @@ "name": "HighlighterFragmenter", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/highlighting.ts#L61-L64" + "specLocation": "_global/search/_types/highlighting.ts#L66-L69" }, { "kind": "enum", @@ -26341,7 +26379,7 @@ "name": "HighlighterOrder", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/highlighting.ts#L66-L68" + "specLocation": "_global/search/_types/highlighting.ts#L71-L73" }, { "kind": "enum", @@ -26354,7 +26392,7 @@ "name": "HighlighterTagsSchema", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/highlighting.ts#L70-L72" + "specLocation": "_global/search/_types/highlighting.ts#L75-L77" }, { "isOpen": true, @@ -26375,7 +26413,7 @@ "name": "HighlighterType", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/highlighting.ts#L74-L80" + "specLocation": "_global/search/_types/highlighting.ts#L79-L85" }, { "generics": [ @@ -28285,7 +28323,7 @@ "properties": [ { "name": "fuzziness", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -28296,7 +28334,7 @@ }, { "name": "min_length", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -28307,7 +28345,7 @@ }, { "name": "prefix_length", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -28318,7 +28356,7 @@ }, { "name": "transpositions", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -28329,7 +28367,7 @@ }, { "name": "unicode_aware", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -30500,7 +30538,7 @@ }, { "name": "tokens", - "required": true, + "required": false, "type": { "kind": "array_of", "value": { @@ -31348,7 +31386,7 @@ "type": { "kind": "instance_of", "type": { - "name": "long", + "name": "Slices", "namespace": "_types" } } @@ -31456,7 +31494,7 @@ } } ], - "specLocation": "_global/update_by_query/UpdateByQueryRequest.ts#L36-L84" + "specLocation": "_global/update_by_query/UpdateByQueryRequest.ts#L37-L85" }, { "body": { @@ -37198,6 +37236,52 @@ ], "specLocation": "_types/SlicedScroll.ts#L23-L27" }, + { + "codegenNames": [ + "value", + "computed" + ], + "description": "Slices configuration used to parallelize a process.", + "kind": "type_alias", + "name": { + "name": "Slices", + "namespace": "_types" + }, + "specLocation": "_types/common.ts#L319-L324", + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "SlicesCalculation", + "namespace": "_types" + } + } + ], + "kind": "union_of" + } + }, + { + "kind": "enum", + "members": [ + { + "description": "Let Elasticsearch choose a reasonable number for most data streams and indices.", + "name": "auto" + } + ], + "name": { + "name": "SlicesCalculation", + "namespace": "_types" + }, + "specLocation": "_types/common.ts#L326-L334" + }, { "kind": "type_alias", "name": { @@ -57039,6 +57123,272 @@ }, "specLocation": "_types/mapping/dynamic-template.ts#L37-L46" }, + { + "inherits": { + "type": { + "name": "DocValuesPropertyBase", + "namespace": "_types.mapping" + } + }, + "kind": "interface", + "name": { + "name": "DynamicProperty", + "namespace": "_types.mapping" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "{dynamic_property}" + } + }, + { + "name": "enabled", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "null_value", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "FieldValue", + "namespace": "_types" + } + } + }, + { + "name": "boost", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + }, + { + "name": "coerce", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "script", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Script", + "namespace": "_types" + } + } + }, + { + "name": "on_script_error", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "OnScriptError", + "namespace": "_types.mapping" + } + } + }, + { + "name": "ignore_malformed", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "time_series_metric", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TimeSeriesMetricType", + "namespace": "_types.mapping" + } + } + }, + { + "name": "analyzer", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "eager_global_ordinals", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "index", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "index_options", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexOptions", + "namespace": "_types.mapping" + } + } + }, + { + "name": "index_phrases", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "index_prefixes", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TextIndexPrefixes", + "namespace": "_types.mapping" + } + } + }, + { + "name": "norms", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "position_increment_gap", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "search_analyzer", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "search_quote_analyzer", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "term_vector", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TermVectorOption", + "namespace": "_types.mapping" + } + } + }, + { + "name": "format", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "precision_step", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "locale", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "_types/mapping/core.ts#L316-L347" + }, { "kind": "interface", "name": { @@ -57359,7 +57709,7 @@ "name": "FieldType", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L69-L112" + "specLocation": "_types/mapping/Property.ts#L71-L114" }, { "inherits": { @@ -58673,7 +59023,7 @@ "name": "Property", "namespace": "_types.mapping" }, - "specLocation": "_types/mapping/Property.ts#L52-L67", + "specLocation": "_types/mapping/Property.ts#L53-L69", "type": { "items": [ { @@ -58752,6 +59102,13 @@ "name": "CoreProperty", "namespace": "_types.mapping" } + }, + { + "kind": "instance_of", + "type": { + "name": "DynamicProperty", + "namespace": "_types.mapping" + } } ], "kind": "union_of" @@ -58872,7 +59229,7 @@ } } ], - "specLocation": "_types/mapping/Property.ts#L42-L50" + "specLocation": "_types/mapping/Property.ts#L43-L51" }, { "kind": "type_alias", @@ -95598,12 +95955,12 @@ } }, { - "name": "name", + "name": "_meta", "required": false, "type": { "kind": "instance_of", "type": { - "name": "Name", + "name": "Metadata", "namespace": "_types" } } @@ -100840,7 +101197,7 @@ } } ], - "specLocation": "indices/analyze/types.ts#L22-L28" + "specLocation": "indices/analyze/types.ts#L24-L30" }, { "kind": "interface", @@ -100916,7 +101273,7 @@ } } ], - "specLocation": "indices/analyze/types.ts#L35-L42" + "specLocation": "indices/analyze/types.ts#L37-L44" }, { "kind": "interface", @@ -100951,7 +101308,7 @@ } } ], - "specLocation": "indices/analyze/types.ts#L30-L33" + "specLocation": "indices/analyze/types.ts#L32-L35" }, { "kind": "interface", @@ -100986,9 +101343,32 @@ } } ], - "specLocation": "indices/analyze/types.ts#L44-L47" + "specLocation": "indices/analyze/types.ts#L46-L49" }, { + "attachedBehaviors": [ + "AdditionalProperties" + ], + "behaviors": [ + { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + { + "kind": "user_defined_value" + } + ], + "type": { + "name": "AdditionalProperties", + "namespace": "_spec_utils" + } + } + ], "kind": "interface", "name": { "name": "ExplainAnalyzeToken", @@ -101095,7 +101475,7 @@ } } ], - "specLocation": "indices/analyze/types.ts#L49-L59" + "specLocation": "indices/analyze/types.ts#L52-L64" }, { "attachedBehaviors": [ @@ -101287,7 +101667,7 @@ "name": "TextToAnalyze", "namespace": "indices.analyze" }, - "specLocation": "indices/analyze/types.ts#L61-L61", + "specLocation": "indices/analyze/types.ts#L66-L66", "type": { "items": [ { @@ -101344,7 +101724,7 @@ } } ], - "specLocation": "indices/analyze/types.ts#L63-L66" + "specLocation": "indices/analyze/types.ts#L68-L71" }, { "attachedBehaviors": [ @@ -152626,41 +153006,6 @@ }, "specLocation": "security/clear_cached_service_tokens/ClearCachedServiceTokensResponse.ts#L25-L32" }, - { - "kind": "interface", - "name": { - "name": "IndexPrivileges", - "namespace": "security.create_api_key" - }, - "properties": [ - { - "name": "names", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Indices", - "namespace": "_types" - } - } - }, - { - "name": "privileges", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "IndexPrivilege", - "namespace": "security._types" - } - } - } - } - ], - "specLocation": "security/create_api_key/types.ts#L32-L35" - }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -152857,19 +153202,48 @@ } }, { - "name": "index", + "aliases": [ + "index" + ], + "name": "indices", "required": true, "type": { "kind": "array_of", "value": { "kind": "instance_of", "type": { - "name": "IndexPrivileges", - "namespace": "security.create_api_key" + "name": "IndicesPrivileges", + "namespace": "security._types" } } } }, + { + "name": "global", + "required": false, + "type": { + "items": [ + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "GlobalPrivilege", + "namespace": "security._types" + } + } + }, + { + "kind": "instance_of", + "type": { + "name": "GlobalPrivilege", + "namespace": "security._types" + } + } + ], + "kind": "union_of" + } + }, { "name": "applications", "required": false, @@ -152883,9 +153257,45 @@ } } } + }, + { + "name": "metadata", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Metadata", + "namespace": "_types" + } + } + }, + { + "name": "run_as", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "name": "transient_metadata", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TransientMetadataConfig", + "namespace": "security._types" + } + } } ], - "specLocation": "security/create_api_key/types.ts#L26-L30" + "specLocation": "security/create_api_key/types.ts#L30-L39" }, { "attachedBehaviors": [ @@ -154592,6 +155002,9 @@ } }, { + "aliases": [ + "index" + ], "name": "indices", "required": true, "type": { @@ -154682,7 +155095,7 @@ } } ], - "specLocation": "security/get_service_accounts/types.ts#L32-L40" + "specLocation": "security/get_service_accounts/types.ts#L32-L41" }, { "kind": "interface", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 029223d212..ab32c139de 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1620,7 +1620,8 @@ "Request: query parameter 'allow_no_indices' does not exist in the json spec", "Request: query parameter 'expand_wildcards' does not exist in the json spec", "Request: query parameter 'ignore_throttled' does not exist in the json spec", - "Request: query parameter 'ignore_unavailable' does not exist in the json spec" + "Request: query parameter 'ignore_unavailable' does not exist in the json spec", + "Request: query parameter 'routing' does not exist in the json spec" ], "response": [] }, @@ -1834,6 +1835,12 @@ ], "response": [] }, + "security.create_api_key": { + "request": [ + "interface definition security._types:RoleTemplateQueryContainer - Property template is a single-variant and must be required" + ], + "response": [] + }, "security.create_service_token": { "request": [ "Request: missing json spec query parameter 'refresh'", @@ -1933,9 +1940,7 @@ "request": [ "Request: should not have a body" ], - "response": [ - "interface definition security._types:RoleTemplateQueryContainer - Property template is a single-variant and must be required" - ] + "response": [] }, "security.get_role_mapping": { "request": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index b7f2d640bf..b59a29469c 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -203,7 +203,7 @@ export interface DeleteByQueryRequest extends RequestBase { scroll_size?: long search_timeout?: Time search_type?: SearchType - slices?: long + slices?: Slices sort?: string[] stats?: string[] terminate_after?: long @@ -562,20 +562,31 @@ export interface MsearchMultiSearchResult { export interface MsearchMultisearchBody { aggregations?: Record aggs?: Record + collapse?: SearchFieldCollapse query?: QueryDslQueryContainer explain?: boolean stored_fields?: Fields docvalue_fields?: (QueryDslFieldAndFormat | Field)[] from?: integer + highlight?: SearchHighlight + indices_boost?: Record[] + min_score?: double + post_filter?: QueryDslQueryContainer + profile?: boolean + rescore?: SearchRescore | SearchRescore[] + script_fields?: Record + search_after?: SortResults size?: integer sort?: Sort _source?: SearchSourceConfig + fields?: (QueryDslFieldAndFormat | Field)[] terminate_after?: long stats?: string[] timeout?: string track_scores?: boolean track_total_hits?: SearchTrackHits version?: boolean + runtime_mappings?: MappingRuntimeFields seq_no_primary_term?: boolean pit?: SearchPointInTimeReference suggest?: SearchSuggester @@ -588,7 +599,7 @@ export interface MsearchMultisearchHeader { index?: Indices preference?: string request_cache?: boolean - routing?: string + routing?: Routing search_type?: SearchType ccs_minimize_roundtrips?: boolean allow_partial_search_results?: boolean @@ -605,8 +616,9 @@ export interface MsearchRequest extends RequestBase { max_concurrent_searches?: long max_concurrent_shard_requests?: long pre_filter_shard_size?: long - search_type?: SearchType rest_total_hits_as_int?: boolean + routing?: Routing + search_type?: SearchType typed_keys?: boolean body?: MsearchRequestItem[] } @@ -819,18 +831,19 @@ export interface ReindexDestination { } export interface ReindexRemoteSource { - connect_timeout: Time + connect_timeout?: Time + headers?: Record host: Host - username: Username - password: Password - socket_timeout: Time + username?: Username + password?: Password + socket_timeout?: Time } export interface ReindexRequest extends RequestBase { refresh?: boolean requests_per_second?: long scroll?: Time - slices?: long + slices?: Slices timeout?: Time wait_for_active_shards?: WaitForActiveShards wait_for_completion?: boolean @@ -1214,51 +1227,38 @@ export interface SearchFieldSuggester { text?: string } -export interface SearchHighlight { - fields: Record - type?: SearchHighlighterType - boundary_chars?: string - boundary_max_scan?: integer - boundary_scanner?: SearchBoundaryScanner - boundary_scanner_locale?: string +export interface SearchHighlight extends SearchHighlightBase { encoder?: SearchHighlighterEncoder - fragmenter?: SearchHighlighterFragmenter - fragment_offset?: integer - fragment_size?: integer - max_fragment_length?: integer - no_match_size?: integer - number_of_fragments?: integer - order?: SearchHighlighterOrder - post_tags?: string[] - pre_tags?: string[] - require_field_match?: boolean - tags_schema?: SearchHighlighterTagsSchema - highlight_query?: QueryDslQueryContainer - max_analyzed_offset?: string | integer + fields: Record } -export interface SearchHighlightField { +export interface SearchHighlightBase { + type?: SearchHighlighterType boundary_chars?: string boundary_max_scan?: integer boundary_scanner?: SearchBoundaryScanner boundary_scanner_locale?: string - field?: Field force_source?: boolean fragmenter?: SearchHighlighterFragmenter - fragment_offset?: integer fragment_size?: integer + highlight_filter?: boolean highlight_query?: QueryDslQueryContainer - matched_fields?: Fields max_fragment_length?: integer + max_analyzed_offset?: integer no_match_size?: integer number_of_fragments?: integer + options?: Record order?: SearchHighlighterOrder phrase_limit?: integer post_tags?: string[] pre_tags?: string[] require_field_match?: boolean tags_schema?: SearchHighlighterTagsSchema - type?: SearchHighlighterType +} + +export interface SearchHighlightField extends SearchHighlightBase { + fragment_offset?: integer + matched_fields?: Fields } export type SearchHighlighterEncoder = 'default' | 'html' @@ -1477,11 +1477,11 @@ export interface SearchSuggestBase { } export interface SearchSuggestFuzziness { - fuzziness: Fuzziness - min_length: integer - prefix_length: integer - transpositions: boolean - unicode_aware: boolean + fuzziness?: Fuzziness + min_length?: integer + prefix_length?: integer + transpositions?: boolean + unicode_aware?: boolean } export type SearchSuggestSort = 'score' | 'frequency' @@ -1697,7 +1697,7 @@ export interface TermvectorsTerm { doc_freq?: integer score?: double term_freq: integer - tokens: TermvectorsToken[] + tokens?: TermvectorsToken[] ttf?: integer } @@ -1768,7 +1768,7 @@ export interface UpdateByQueryRequest extends RequestBase { scroll_size?: long search_timeout?: Time search_type?: SearchType - slices?: long + slices?: Slices sort?: string[] stats?: string[] terminate_after?: long @@ -2394,6 +2394,10 @@ export interface SlicedScroll { max: integer } +export type Slices = integer | SlicesCalculation + +export type SlicesCalculation = 'auto' + export type Sort = SortCombinations | SortCombinations[] export type SortCombinations = Field | SortOptions @@ -4573,6 +4577,32 @@ export interface MappingDoubleRangeProperty extends MappingRangePropertyBase { export type MappingDynamicMapping = boolean | 'strict' | 'runtime' | 'true' | 'false' +export interface MappingDynamicProperty extends MappingDocValuesPropertyBase { + type: '{dynamic_property}' + enabled?: boolean + null_value?: FieldValue + boost?: double + coerce?: boolean + script?: Script + on_script_error?: MappingOnScriptError + ignore_malformed?: boolean + time_series_metric?: MappingTimeSeriesMetricType + analyzer?: string + eager_global_ordinals?: boolean + index?: boolean + index_options?: MappingIndexOptions + index_phrases?: boolean + index_prefixes?: MappingTextIndexPrefixes + norms?: boolean + position_increment_gap?: integer + search_analyzer?: string + search_quote_analyzer?: string + term_vector?: MappingTermVectorOption + format?: string + precision_step?: integer + locale?: string +} + export interface MappingDynamicTemplate { mapping?: MappingProperty match?: string @@ -4751,7 +4781,7 @@ export interface MappingPointProperty extends MappingDocValuesPropertyBase { type: 'point' } -export type MappingProperty = MappingFlattenedProperty | MappingJoinProperty | MappingPercolatorProperty | MappingRankFeatureProperty | MappingRankFeaturesProperty | MappingConstantKeywordProperty | MappingFieldAliasProperty | MappingHistogramProperty | MappingDenseVectorProperty | MappingAggregateMetricDoubleProperty | MappingCoreProperty +export type MappingProperty = MappingFlattenedProperty | MappingJoinProperty | MappingPercolatorProperty | MappingRankFeatureProperty | MappingRankFeaturesProperty | MappingConstantKeywordProperty | MappingFieldAliasProperty | MappingHistogramProperty | MappingDenseVectorProperty | MappingAggregateMetricDoubleProperty | MappingCoreProperty | MappingDynamicProperty export interface MappingPropertyBase { local_metadata?: Metadata @@ -9012,7 +9042,7 @@ export interface IlmPhases { export interface IlmPolicy { phases: IlmPhases - name?: Name + _meta?: Metadata } export interface IlmShrinkConfiguration { @@ -9643,7 +9673,7 @@ export interface IndicesAnalyzeCharFilterDetail { name: string } -export interface IndicesAnalyzeExplainAnalyzeToken { +export interface IndicesAnalyzeExplainAnalyzeTokenKeys { bytes: string end_offset: long keyword?: boolean @@ -9654,6 +9684,8 @@ export interface IndicesAnalyzeExplainAnalyzeToken { token: string type: string } +export type IndicesAnalyzeExplainAnalyzeToken = IndicesAnalyzeExplainAnalyzeTokenKeys + & { [property: string]: any } export interface IndicesAnalyzeRequest extends RequestBase { index?: IndexName @@ -15259,11 +15291,6 @@ export interface SecurityClearCachedServiceTokensResponse { nodes: Record } -export interface SecurityCreateApiKeyIndexPrivileges { - names: Indices - privileges: SecurityIndexPrivilege[] -} - export interface SecurityCreateApiKeyRequest extends RequestBase { refresh?: Refresh body?: { @@ -15284,8 +15311,13 @@ export interface SecurityCreateApiKeyResponse { export interface SecurityCreateApiKeyRoleDescriptor { cluster: string[] - index: SecurityCreateApiKeyIndexPrivileges[] + indices: SecurityIndicesPrivileges[] + index: SecurityIndicesPrivileges[] + global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege applications?: SecurityApplicationPrivileges[] + metadata?: Metadata + run_as?: string[] + transient_metadata?: SecurityTransientMetadataConfig } export interface SecurityCreateServiceTokenRequest extends RequestBase { @@ -15476,6 +15508,7 @@ export type SecurityGetServiceAccountsResponse = Record + collapse?: FieldCollapse /** * Defines the search definition using the Query DSL. */ @@ -95,6 +98,24 @@ export class MultisearchBody { * @server_default 0 */ from?: integer + highlight?: Highlight + /** + * Boosts the _score of documents from specified indices. + */ + indices_boost?: Array> + /** + * Minimum _score for matching documents. Documents with a lower _score are + * not included in the search results. + */ + min_score?: double + post_filter?: QueryContainer + profile?: boolean + rescore?: Rescore | Rescore[] + /** + * Retrieve a script evaluation (based on different fields) for each hit. + */ + script_fields?: Dictionary + search_after?: SortResults /** * The number of hits to return. By default, you cannot page through more * than 10,000 hits using the from and size parameters. To page through more @@ -109,6 +130,11 @@ export class MultisearchBody { * fields are returned in the hits._source property of the search response. */ _source?: SourceConfig + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + */ + fields?: Array /** * Maximum number of documents to collect for each shard. If a query reaches this * limit, Elasticsearch terminates the query early. Elasticsearch collects documents @@ -145,6 +171,11 @@ export class MultisearchBody { * @server_default false */ version?: boolean + /** + * Defines one or more runtime fields in the search request. These fields take + * precedence over mapped fields with the same name. + */ + runtime_mappings?: RuntimeFields /** * If true, returns sequence number and primary term of the last modification * of each hit. See Optimistic concurrency control. diff --git a/specification/_global/reindex/ReindexRequest.ts b/specification/_global/reindex/ReindexRequest.ts index ee4aa4ae13..eccf89f301 100644 --- a/specification/_global/reindex/ReindexRequest.ts +++ b/specification/_global/reindex/ReindexRequest.ts @@ -18,7 +18,7 @@ */ import { RequestBase } from '@_types/Base' -import { Conflicts, WaitForActiveShards } from '@_types/common' +import { Conflicts, Slices, WaitForActiveShards } from '@_types/common' import { long } from '@_types/Numeric' import { Script } from '@_types/Scripting' import { Time } from '@_types/Time' @@ -34,7 +34,7 @@ export interface Request extends RequestBase { refresh?: boolean requests_per_second?: long scroll?: Time - slices?: long + slices?: Slices timeout?: Time wait_for_active_shards?: WaitForActiveShards wait_for_completion?: boolean diff --git a/specification/_global/reindex/types.ts b/specification/_global/reindex/types.ts index b637ff44fb..ef7c1a7608 100644 --- a/specification/_global/reindex/types.ts +++ b/specification/_global/reindex/types.ts @@ -34,6 +34,7 @@ import { integer } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' import { SlicedScroll } from '@_types/SlicedScroll' import { Time } from '@_types/Time' +import { Dictionary } from '@spec_utils/Dictionary' export class Destination { index: IndexName @@ -56,9 +57,10 @@ export class Source { } export class RemoteSource { - connect_timeout: Time + connect_timeout?: Time + headers?: Dictionary host: Host - username: Username - password: Password - socket_timeout: Time + username?: Username + password?: Password + socket_timeout?: Time } diff --git a/specification/_global/search/SearchRequest.ts b/specification/_global/search/SearchRequest.ts index c9ba136a23..029fdfd803 100644 --- a/specification/_global/search/SearchRequest.ts +++ b/specification/_global/search/SearchRequest.ts @@ -107,6 +107,7 @@ export interface Request extends RequestBase { from?: integer sort?: string | string[] } + // We should keep this in sync with the multi search request body. body: { /** @aliases aggs */ // ES uses "aggregations" in serialization aggregations?: Dictionary diff --git a/specification/_global/search/_types/highlighting.ts b/specification/_global/search/_types/highlighting.ts index f8e25c0402..43168a609d 100644 --- a/specification/_global/search/_types/highlighting.ts +++ b/specification/_global/search/_types/highlighting.ts @@ -21,6 +21,7 @@ import { Dictionary } from '@spec_utils/Dictionary' import { Field, Fields } from '@_types/common' import { integer } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' export enum BoundaryScanner { chars = 0, @@ -28,29 +29,33 @@ export enum BoundaryScanner { word = 2 } -export class Highlight { - fields: Dictionary - +export class HighlightBase { type?: HighlighterType boundary_chars?: string boundary_max_scan?: integer boundary_scanner?: BoundaryScanner boundary_scanner_locale?: string - encoder?: HighlighterEncoder + force_source?: boolean fragmenter?: HighlighterFragmenter - fragment_offset?: integer fragment_size?: integer + highlight_filter?: boolean + highlight_query?: QueryContainer max_fragment_length?: integer + max_analyzed_offset?: integer no_match_size?: integer number_of_fragments?: integer + options?: Dictionary order?: HighlighterOrder + phrase_limit?: integer post_tags?: string[] pre_tags?: string[] require_field_match?: boolean tags_schema?: HighlighterTagsSchema - highlight_query?: QueryContainer - // TODO this is too lenient! test reports "20" is accepted - max_analyzed_offset?: string | integer +} + +export class Highlight extends HighlightBase { + encoder?: HighlighterEncoder + fields: Dictionary } export enum HighlighterEncoder { @@ -79,27 +84,7 @@ export enum HighlighterType { unified = 2 } -export class HighlightField { - boundary_chars?: string - boundary_max_scan?: integer - boundary_scanner?: BoundaryScanner - boundary_scanner_locale?: string - //TODO I THINK this field does not exist - field?: Field - force_source?: boolean - fragmenter?: HighlighterFragmenter +export class HighlightField extends HighlightBase { fragment_offset?: integer - fragment_size?: integer - highlight_query?: QueryContainer matched_fields?: Fields - max_fragment_length?: integer - no_match_size?: integer - number_of_fragments?: integer - order?: HighlighterOrder - phrase_limit?: integer - post_tags?: string[] - pre_tags?: string[] - require_field_match?: boolean - tags_schema?: HighlighterTagsSchema - type?: HighlighterType } diff --git a/specification/_global/search/_types/suggester.ts b/specification/_global/search/_types/suggester.ts index f2177eaa09..5efe9f1ff3 100644 --- a/specification/_global/search/_types/suggester.ts +++ b/specification/_global/search/_types/suggester.ts @@ -131,11 +131,11 @@ export class CompletionSuggester extends SuggesterBase { } export class SuggestFuzziness { - fuzziness: Fuzziness - min_length: integer - prefix_length: integer - transpositions: boolean - unicode_aware: boolean + fuzziness?: Fuzziness + min_length?: integer + prefix_length?: integer + transpositions?: boolean + unicode_aware?: boolean } // context suggester diff --git a/specification/_global/termvectors/types.ts b/specification/_global/termvectors/types.ts index 721bb7da0e..501bada5c7 100644 --- a/specification/_global/termvectors/types.ts +++ b/specification/_global/termvectors/types.ts @@ -35,7 +35,7 @@ export class Term { doc_freq?: integer score?: double term_freq: integer - tokens: Token[] + tokens?: Token[] ttf?: integer } diff --git a/specification/_global/update_by_query/UpdateByQueryRequest.ts b/specification/_global/update_by_query/UpdateByQueryRequest.ts index 8b1ac38701..d445a526f3 100644 --- a/specification/_global/update_by_query/UpdateByQueryRequest.ts +++ b/specification/_global/update_by_query/UpdateByQueryRequest.ts @@ -24,6 +24,7 @@ import { Indices, Routing, SearchType, + Slices, WaitForActiveShards } from '@_types/common' import { long } from '@_types/Numeric' @@ -64,7 +65,7 @@ export interface Request extends RequestBase { scroll_size?: long search_timeout?: Time search_type?: SearchType - slices?: long + slices?: Slices sort?: string[] stats?: string[] terminate_after?: long diff --git a/specification/_types/common.ts b/specification/_types/common.ts index 32e79a0bc9..82929070a4 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -315,3 +315,20 @@ export class IndicesOptions { */ ignore_throttled?: boolean } + +/** + * Slices configuration used to parallelize a process. + * + * @codegen_names value, computed + */ +export type Slices = integer | SlicesCalculation + +/** + * Named computations to calculate the number of slices + */ +export enum SlicesCalculation { + /** + * Let Elasticsearch choose a reasonable number for most data streams and indices. + */ + auto +} diff --git a/specification/_types/mapping/Property.ts b/specification/_types/mapping/Property.ts index abe41c4034..20ceec94cf 100644 --- a/specification/_types/mapping/Property.ts +++ b/specification/_types/mapping/Property.ts @@ -27,6 +27,7 @@ import { } from './complex' import { CoreProperty, + DynamicProperty, JoinProperty, PercolatorProperty, RankFeatureProperty, @@ -65,6 +66,7 @@ export type Property = | DenseVectorProperty | AggregateMetricDoubleProperty | CoreProperty + | DynamicProperty export enum FieldType { none, diff --git a/specification/_types/mapping/core.ts b/specification/_types/mapping/core.ts index bccd52b447..a731dfc699 100644 --- a/specification/_types/mapping/core.ts +++ b/specification/_types/mapping/core.ts @@ -20,7 +20,7 @@ import { FielddataFrequencyFilter } from '@indices/_types/FielddataFrequencyFilter' import { NumericFielddata } from '@indices/_types/NumericFielddata' import { Dictionary } from '@spec_utils/Dictionary' -import { Fields, PropertyName, RelationName } from '@_types/common' +import { Fields, FieldValue, PropertyName, RelationName } from '@_types/common' import { byte, double, @@ -312,3 +312,36 @@ export class WildcardProperty extends DocValuesPropertyBase { /** @since 7.15.0 */ null_value?: string } + +export class DynamicProperty extends DocValuesPropertyBase { + type: '{dynamic_property}' + + enabled?: boolean + null_value?: FieldValue + boost?: double + + // NumberPropertyBase & long, double + coerce?: boolean + script?: Script + on_script_error?: OnScriptError + ignore_malformed?: boolean + time_series_metric?: TimeSeriesMetricType + + // string + analyzer?: string + eager_global_ordinals?: boolean + index?: boolean + index_options?: IndexOptions + index_phrases?: boolean + index_prefixes?: TextIndexPrefixes + norms?: boolean + position_increment_gap?: integer + search_analyzer?: string + search_quote_analyzer?: string + term_vector?: TermVectorOption + + // date + format?: string + precision_step?: integer + locale?: string +} diff --git a/specification/ilm/_types/Policy.ts b/specification/ilm/_types/Policy.ts index 35cd64057a..c98d057860 100644 --- a/specification/ilm/_types/Policy.ts +++ b/specification/ilm/_types/Policy.ts @@ -17,10 +17,10 @@ * under the License. */ -import { Name } from '@_types/common' +import { Metadata, Name } from '@_types/common' import { Phases } from './Phase' export class Policy { phases: Phases - name?: Name + _meta?: Metadata } diff --git a/specification/indices/analyze/types.ts b/specification/indices/analyze/types.ts index cf04f9a3d4..67c42ad2dd 100644 --- a/specification/indices/analyze/types.ts +++ b/specification/indices/analyze/types.ts @@ -18,6 +18,8 @@ */ import { long } from '@_types/Numeric' +import { AdditionalProperties } from '@spec_utils/behaviors' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' export class AnalyzeDetail { analyzer?: AnalyzerDetail @@ -46,7 +48,10 @@ export class CharFilterDetail { name: string } -export class ExplainAnalyzeToken { +// Additional properties are attributes that can be set by plugin-defined tokenizers +export class ExplainAnalyzeToken + implements AdditionalProperties +{ bytes: string end_offset: long keyword?: boolean diff --git a/specification/security/create_api_key/types.ts b/specification/security/create_api_key/types.ts index 89923ab138..26680309e4 100644 --- a/specification/security/create_api_key/types.ts +++ b/specification/security/create_api_key/types.ts @@ -19,14 +19,23 @@ import { IndexPrivilege, - ApplicationPrivileges + ApplicationPrivileges, + IndicesPrivileges, + GlobalPrivilege } from '@security/_types/Privileges' -import { Indices } from '@_types/common' +import { Indices, Metadata } from '@_types/common' +import { TransientMetadataConfig } from '@security/_types/TransientMetadataConfig' +// FIXME: should be merged with get_service_accounts/RoleDescriptor export class RoleDescriptor { cluster: string[] - index: IndexPrivileges[] + /** @aliases index */ + indices: IndicesPrivileges[] + global?: GlobalPrivilege[] | GlobalPrivilege applications?: ApplicationPrivileges[] + metadata?: Metadata + run_as?: string[] + transient_metadata?: TransientMetadataConfig } export class IndexPrivileges { diff --git a/specification/security/get_service_accounts/types.ts b/specification/security/get_service_accounts/types.ts index 3091042be0..340b8c4e70 100644 --- a/specification/security/get_service_accounts/types.ts +++ b/specification/security/get_service_accounts/types.ts @@ -31,6 +31,7 @@ export class RoleDescriptorWrapper { export class RoleDescriptor { cluster: string[] + /** @aliases index */ indices: IndicesPrivileges[] global?: GlobalPrivilege[] | GlobalPrivilege applications?: ApplicationPrivileges[] diff --git a/typescript-generator/src/metamodel.ts b/typescript-generator/src/metamodel.ts index da0c021c31..fe0b1f8b2a 100644 --- a/typescript-generator/src/metamodel.ts +++ b/typescript-generator/src/metamodel.ts @@ -139,6 +139,8 @@ export class Property { aliases?: string[] /** If the enclosing class is a variants container, is this a property of the container and not a variant? */ containerProperty?: boolean + /** If this property has a quirk that needs special attention, give a short explanation about it */ + esQuirk?: string } // ------------------------------------------------------------------------------------------------ @@ -158,6 +160,8 @@ export abstract class BaseType { docUrl?: string docId?: string deprecation?: Deprecation + /** If this endpoint has a quirk that needs special attention, give a short explanation about it */ + esQuirk?: string kind: string /** Variant name for externally tagged variants */ variantName?: string @@ -177,11 +181,20 @@ export abstract class BaseType { export type Variants = ExternalTag | InternalTag | Container -export class ExternalTag { +export class VariantBase { + /** + * Is this variant type open to extensions? Default to false. Used for variants that can + * be extended with plugins. If true, target clients should allow for additional variants + * with a variant tag outside the ones defined in the spec and arbitrary data as the value. + */ + nonExhaustive?: boolean +} + +export class ExternalTag extends VariantBase { kind: 'external_tag' } -export class InternalTag { +export class InternalTag extends VariantBase { kind: 'internal_tag' /* Name of the property that holds the variant tag */ tag: string @@ -189,7 +202,7 @@ export class InternalTag { defaultTag?: string } -export class Container { +export class Container extends VariantBase { kind: 'container' }