From 67a70ab47810149d15b9311334be6051d919018f Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 22 Oct 2024 08:44:12 +1300 Subject: [PATCH] Fix code generation enum handling (#836) Signed-off-by: Thomas Farr --- .../Generator/ApiEndpointFactory.cs | 54 +- src/ApiGenerator/Generator/ApiGenerator.cs | 2 +- src/ApiGenerator/Generator/OpenApiUtils.cs | 49 + src/ApiGenerator/opensearch-openapi.yaml | 926 ++++++++++-------- .../RequestParameters.Notifications.cs | 14 + 5 files changed, 611 insertions(+), 434 deletions(-) create mode 100644 src/ApiGenerator/Generator/OpenApiUtils.cs diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs index 22d6aaf551..caa9066ccd 100644 --- a/src/ApiGenerator/Generator/ApiEndpointFactory.cs +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -139,9 +139,7 @@ Action trackEnumToGenerate Body body = null; if (variants.Select(v => v.Operation.RequestBody).FirstOrDefault() is { } requestBody) - { body = new Body { Description = GetDescription(requestBody)?.SanitizeDescription(), Required = requestBody.IsRequired }; - } return new ApiEndpoint { @@ -175,11 +173,11 @@ Action trackEnumToGenerate List paramCombo ) { - if (i == paramCount) return new[] { (variantHttpPath, paramCombo) }; + if (i == paramCount) return [(variantHttpPath, paramCombo)]; var originalParameter = pathParams[i]; var overloads = !originalParameter.IsOverloaded() - ? new[] { (variantHttpPath, new PathParameter(originalParameter)) } + ? [(variantHttpPath, new PathParameter(originalParameter))] : originalParameter.Schema.AnyOf .Select(overload => ( @@ -188,7 +186,7 @@ List paramCombo ) ); - return overloads.SelectMany(o => GenerateVariants(o.HttpPath, i + 1, new List(paramCombo) { o.PathParameter })); + return overloads.SelectMany(o => GenerateVariants(o.HttpPath, i + 1, [..paramCombo, o.PathParameter])); } } @@ -227,36 +225,31 @@ private static string GetOpenSearchType(JsonSchema schema, Action var schemaKey = ((IJsonReference)schema).ReferencePath?.Split('/').Last(); schema = schema.ActualSchema; + if (schemaKey != null && schema.IsEnum()) + { + trackEnumToGenerate(schemaKey, isListContext); + return CsharpNames.GetEnumName(schemaKey) + "?"; + } + if (schema.OneOf.Count > 0 || schema.AnyOf.Count > 0) { var oneOf = (schema.OneOf.Count > 0 ? schema.OneOf : schema.AnyOf).ToArray(); - if (oneOf.Length == 2) - { - var first = GetOpenSearchType(oneOf[0], trackEnumToGenerate); - var second = GetOpenSearchType(oneOf[1], trackEnumToGenerate); - if (first.EndsWith("?")) return first; - if (first == second) return first; - - return (first, second) switch - { - (_, "list") => second, - ("boolean", "string") => first, - ("number", _) => "string", - (_, "number") => "string", - (_, _) => throw new Exception($"Unable to determine type of: {first} and {second}") - }; - } + if (oneOf.Length != 2) throw new Exception("Unable to determine type of oneOf"); - throw new Exception("Unable to determine type of oneOf"); - } + var first = GetOpenSearchType(oneOf[0], trackEnumToGenerate); + var second = GetOpenSearchType(oneOf[1], trackEnumToGenerate); + if (first.EndsWith("?")) return first; + if (first == second) return first; - var enumOptions = schema.Enumeration.Where(e => e != null).Select(e => e.ToString()).ToList(); - - if (schemaKey != null && schema.Type == JsonObjectType.String && enumOptions.Count > 0) - { - trackEnumToGenerate(schemaKey, isListContext); - return CsharpNames.GetEnumName(schemaKey) + "?"; + return (first, second) switch + { + (_, "list") => second, + ("boolean", "string") => first, + ("number", _) => "string", + (_, "number") => "string", + (_, _) => throw new Exception($"Unable to determine type of: {first} and {second}") + }; } if (schema.Type == JsonObjectType.Array && (schema.Item?.HasReference ?? false)) @@ -340,8 +333,5 @@ private static Version CoerceVersion(string s) => 2 => new Version($"{s}.0"), _ => new Version(s), }; - - private static object GetExtension(this IJsonExtensionObject schema, string key) => - schema.ExtensionData?.TryGetValue(key, out var value) ?? false ? value : null; } } diff --git a/src/ApiGenerator/Generator/ApiGenerator.cs b/src/ApiGenerator/Generator/ApiGenerator.cs index dfa87f38ed..d109b4505f 100644 --- a/src/ApiGenerator/Generator/ApiGenerator.cs +++ b/src/ApiGenerator/Generator/ApiGenerator.cs @@ -124,7 +124,7 @@ public static async Task CreateRestApiSpecModel(CancellationToken t { Name = CsharpNames.GetEnumName(kvp.Key), IsFlag = kvp.Value, - Options = document.Components.Schemas[kvp.Key].Enumeration.Where(e => e != null).Select(e => e.ToString()).ToImmutableList() + Options = document.Components.Schemas[kvp.Key].GetEnumValues() }) .OrderBy(e => e.Name) .ToImmutableList(); diff --git a/src/ApiGenerator/Generator/OpenApiUtils.cs b/src/ApiGenerator/Generator/OpenApiUtils.cs new file mode 100644 index 0000000000..1f9bb27f6f --- /dev/null +++ b/src/ApiGenerator/Generator/OpenApiUtils.cs @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using NJsonSchema; + +namespace ApiGenerator.Generator; + +public static class OpenApiUtils +{ + public static bool HasOneOf(this JsonSchema schema) => schema.OneOf.Count > 0; + + public static bool IsEnum(this JsonSchema schema) + { + if (schema.Type == JsonObjectType.String) + return schema.Enumeration.Count > 0 || schema.Const() != null; + + return schema.HasOneOf() && schema.OneOf.All(IsEnum); + } + + public static IImmutableList GetEnumValues(this JsonSchema schema) + { + var values = new SortedSet(); + Visit(schema); + return values.ToImmutableList(); + + void Visit(JsonSchema s) + { + if (s.HasOneOf()) + foreach (var oneOf in schema.OneOf) Visit(oneOf); + else if (s.Enumeration.Count > 0) + foreach (var v in s.Enumeration.Where(v => v != null)) values.Add((string) v); + else if (s.Const() != null) + values.Add(s.Const()); + } + } + + public static T Const(this JsonSchema schema) where T: class => + schema.GetExtension("const") as T; + + public static object GetExtension(this IJsonExtensionObject schema, string key) => + schema.ExtensionData?.TryGetValue(key, out var value) ?? false ? value : null; +} diff --git a/src/ApiGenerator/opensearch-openapi.yaml b/src/ApiGenerator/opensearch-openapi.yaml index 6068313934..0b9dbb76d5 100644 --- a/src/ApiGenerator/opensearch-openapi.yaml +++ b/src/ApiGenerator/opensearch-openapi.yaml @@ -4681,6 +4681,8 @@ paths: parameters: - $ref: '#/components/parameters/notifications.get_configs::query.chime.url' - $ref: '#/components/parameters/notifications.get_configs::query.chime.url.keyword' + - $ref: '#/components/parameters/notifications.get_configs::query.config_id' + - $ref: '#/components/parameters/notifications.get_configs::query.config_id_list' - $ref: '#/components/parameters/notifications.get_configs::query.config_type' - $ref: '#/components/parameters/notifications.get_configs::query.created_time_ms' - $ref: '#/components/parameters/notifications.get_configs::query.description' @@ -14419,7 +14421,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form bulk_stream::query.timeout: in: query @@ -14506,7 +14508,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form bulk::query.timeout: in: query @@ -17129,7 +17131,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form count::query.terminate_after: in: query @@ -17185,7 +17187,7 @@ components: description: Comma-separated list of specific routing values. style: form schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' explode: true create::path.id: in: path @@ -17230,7 +17232,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form create::query.timeout: in: query @@ -17541,7 +17543,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form delete_by_query::query.scroll: in: query @@ -17740,7 +17742,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form delete::query.timeout: in: query @@ -17843,7 +17845,7 @@ components: name: routing description: Target the specified primary shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form exists_source::query.version: in: query @@ -17929,7 +17931,7 @@ components: name: routing description: Target the specified primary shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form exists::query.stored_fields: in: query @@ -18057,7 +18059,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form explain::query.stored_fields: in: query @@ -18321,7 +18323,7 @@ components: name: routing description: Target the specified primary shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form get_source::query.version: in: query @@ -18401,7 +18403,7 @@ components: name: routing description: Target the specified primary shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form get::query.stored_fields: in: query @@ -18503,7 +18505,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form index::query.timeout: in: query @@ -21566,7 +21568,7 @@ components: description: Comma-separated list of specific routing values. style: form schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' explode: true knn.search_models::query.scroll: name: scroll @@ -21840,7 +21842,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form mget::query.stored_fields: in: query @@ -22100,7 +22102,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form mtermvectors::query.term_statistics: in: query @@ -22398,6 +22400,20 @@ components: in: query schema: type: string + notifications.get_configs::query.config_id: + name: config_id + in: query + description: Notification configuration ID. + schema: + type: string + notifications.get_configs::query.config_id_list: + name: config_id_list + in: query + description: Notification configuration IDs. + schema: + type: array + items: + type: string notifications.get_configs::query.config_type: name: config_type in: query @@ -23109,7 +23125,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form search_template::path.index: in: path @@ -23201,7 +23217,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form search_template::query.scroll: in: query @@ -23502,7 +23518,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form search::query.scroll: in: query @@ -24650,7 +24666,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form termvectors::query.term_statistics: in: query @@ -24983,7 +24999,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form update_by_query::query.scroll: in: query @@ -25191,7 +25207,7 @@ components: name: routing description: Custom value used to route operations to a specific shard. schema: - $ref: '#/components/schemas/_common:Routing' + $ref: '#/components/schemas/_common:RoutingInQueryString' style: form update::query.timeout: in: query @@ -29692,7 +29708,7 @@ components: type: object properties: accepted: - description: Equals `true` if the snapshot was accepted. Present when the request had `wait_for_completion` set to `false` + description: Returns `true` if the snapshot was accepted. Present when the request had `wait_for_completion` set to `false`. type: boolean snapshot: $ref: '#/components/schemas/snapshot._common:SnapshotInfo' @@ -29719,33 +29735,23 @@ components: schema: type: object properties: - responses: - type: array - items: - $ref: '#/components/schemas/snapshot.get:SnapshotResponseItem' snapshots: type: array items: $ref: '#/components/schemas/snapshot._common:SnapshotInfo' - total: - description: The total number of snapshots that match the request when ignoring size limit or after query parameter. - type: number - remaining: - description: The number of remaining snapshots that were not returned due to size limits and that can be fetched by additional requests using the next field value. - type: number required: - - remaining - - total + - snapshots snapshot.restore@200: content: application/json: schema: type: object properties: + accepted: + description: Returns `true` if the restore was accepted. Present when the request had `wait_for_completion` set to `false`. + type: boolean snapshot: $ref: '#/components/schemas/snapshot.restore:SnapshotRestore' - required: - - snapshot snapshot.status@200: content: application/json: @@ -29959,6 +29965,13 @@ components: _common:BatchSize: type: integer format: int64 + _common:BuiltinScriptLanguage: + type: string + enum: + - expression + - java + - mustache + - painless _common:BulkByScrollFailure: anyOf: - $ref: '#/components/schemas/_common:BulkItemResponseFailure' @@ -29992,7 +30005,7 @@ components: type: integer format: int64 updated: - description: The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it. + description: The number of documents that were successfully updated after the reindex operation. type: integer format: int64 created: @@ -30004,11 +30017,11 @@ components: type: integer format: int64 batches: - description: The number of scroll responses pulled back by the reindex. + description: The number of scroll responses pulled back by the reindex operation. type: integer format: int32 version_conflicts: - description: The number of version conflicts that reindex hits. + description: The number of version conflicts encountered by the reindex operation. type: integer format: int64 noops: @@ -30022,7 +30035,7 @@ components: throttled: $ref: '#/components/schemas/_common:Duration' requests_per_second: - description: The number of requests per second effectively executed during the reindex. + description: The number of requests per second effectively executed during the reindex operation. type: number format: float canceled: @@ -30119,17 +30132,23 @@ components: type: object properties: skipped: - type: number + type: integer + format: int32 successful: - type: number + type: integer + format: int32 total: - type: number + type: integer + format: int32 running: - type: number + type: integer + format: int32 partial: - type: number + type: integer + format: int32 failed: - type: number + type: integer + format: int32 details: type: object additionalProperties: @@ -30145,7 +30164,7 @@ components: type: object properties: size_in_bytes: - description: Total amount, in bytes, of memory used for completion across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used for completion across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' size: $ref: '#/components/schemas/_common:HumanReadableByteCount' @@ -30194,8 +30213,8 @@ components: type: string _common:DateTime: description: |- - A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a - number of milliseconds since the Epoch. OpenSearch accepts both as input, but will generally output a string + A date and time, either as a string whose format depends on the context (defaulting to ISO_8601) or the + number of milliseconds since the epoch. OpenSearch accepts both as an input but will generally output a string. representation. oneOf: - type: string @@ -30241,31 +30260,36 @@ components: properties: count: description: |- - Total number of non-deleted documents across all primary shards assigned to selected nodes. + The total number of non-deleted documents across all primary shards assigned to the selected nodes. This number is based on documents in Lucene segments and may include documents from nested fields. type: number deleted: description: |- - Total number of deleted documents across all primary shards assigned to selected nodes. - This number is based on documents in Lucene segments. - OpenSearch reclaims the disk space of deleted Lucene documents when a segment is merged. + The total number of deleted documents across all primary shards assigned to the selected nodes. + This number is based on the number of documents stored in Lucene segments. + OpenSearch reclaims the disk space previously occupied by the deleted Lucene documents when a segment is merged. type: number required: - count _common:DocStatus: - description: Item level REST category class codes during indexing. + description: The item level REST category class codes during indexing. type: object properties: 1xx: - type: number + type: integer + format: int32 2xx: - type: number + type: integer + format: int32 3xx: - type: number + type: integer + format: int32 4xx: - type: number + type: integer + format: int32 5xx: - type: number + type: integer + format: int32 _common:Duration: description: |- A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and @@ -30273,7 +30297,7 @@ components: pattern: ^([0-9\.]+)(?:d|h|m|s|ms|micros|nanos)$ type: string _common:DurationLarge: - description: 'A date histogram interval. Similar to `Duration` with additional units: `w` (week), `M` (month), `q` (quarter) and `y` (year).' + description: 'A date histogram interval, similar to `Duration`, with support for additional units: `w` (week), `M` (month), `q` (quarter), and `y` (year).' type: string _common:DurationValueUnitMillis: allOf: @@ -30293,13 +30317,13 @@ components: type: object properties: type: - description: The type of error + description: The type of error. type: string reason: - description: A human-readable explanation of the error, in english + description: A human-readable explanation of the error, in English. type: string stack_trace: - description: The server stack trace. Present only if the `error_trace=true` parameter was sent with the request. + description: The server stack trace, present only if the `error_trace=true` parameter was sent with the request. type: string caused_by: $ref: '#/components/schemas/_common:ErrorCause' @@ -30315,7 +30339,7 @@ components: - type additionalProperties: title: metadata - description: Additional details about the error. + description: Any additional information about the error. _common:ErrorResponseBase: type: object properties: @@ -30327,13 +30351,22 @@ components: - error - status _common:ExpandWildcard: - type: string - enum: - - all - - closed - - hidden - - none - - open + oneOf: + - type: string + const: all + description: Match any index, including hidden ones. + - type: string + const: closed + description: Match closed, non-hidden indices. + - type: string + const: hidden + description: Match hidden indices. Must be combined with open, closed, or both. + - type: string + const: none + description: Wildcard expressions are not accepted. + - type: string + const: open + description: Match open, non-hidden indices. _common:ExpandWildcards: oneOf: - $ref: '#/components/schemas/_common:ExpandWildcard' @@ -30341,7 +30374,7 @@ components: items: $ref: '#/components/schemas/_common:ExpandWildcard' _common:Field: - description: Path to field or array of paths. Some API's support wildcards in the path to select multiple fields. + description: The path to a field or an array of paths. Some APIs support wildcards in the path, which allows you to select multiple fields. type: string _common:FielddataStats: type: object @@ -30412,14 +30445,15 @@ components: _common:Fuzziness: oneOf: - type: string - - type: number + - type: integer + format: int32 _common:GeoBounds: description: |- - A geo bounding box. It can be represented in various ways: - - as 4 top/bottom/left/right coordinates - - as 2 top_left / bottom_right points - - as 2 top_right / bottom_left points - - as a WKT bounding box. + A geo-bounding box. It can be represented in the following ways: + - As 4 top/bottom/left/right coordinates. + - As 2 top_left/bottom_right points. + - As 2 top_right/bottom_left points. + - As a Well Known Text (WKT) bounding box. oneOf: - title: coords $ref: '#/components/schemas/_common:CoordsGeoBounds' @@ -30457,9 +30491,10 @@ components: required: - geohash _common:GeoHashPrecision: - description: A precision that can be expressed as a geohash length between 1 and 12, or a distance measure like "1km", "10m". + description: The level of geohash precision, which can be expressed as a geohash length between 1 and 12 or as a distance measure, such as "1km" or "10m". oneOf: - - type: number + - type: integer + format: int32 - type: string _common:GeoHexCell: description: A map hex cell (H3) reference. @@ -30471,22 +30506,23 @@ components: description: Always `"LineString"` type: string coordinates: - description: Array of `[lon, lat]` coordinates + description: An array of `[lon, lat]` coordinates. type: array items: type: array items: type: number + format: double required: - coordinates - type _common:GeoLocation: description: |- - A latitude/longitude as a 2-dimensional point. It can be represented in various ways: - - as a `{lat, long}` object - - as a geo hash value - - as a `[lon, lat]` array - - as a string in `", "` or WKT point formats. + A latitude/longitude as a two-dimensional point. It can be represented in the following ways: + - As a `{lat, long}` object. + - As a geohash value. + - As a `[lon, lat]` array. + - As a string in `", "` or WKT point format. oneOf: - title: latlon $ref: '#/components/schemas/_common:LatLonGeoLocation' @@ -30694,7 +30730,8 @@ components: _seq_no: $ref: '#/components/schemas/_common:SequenceNumber' _primary_term: - type: number + type: integer + format: int32 _routing: $ref: '#/components/schemas/_common:Routing' _source: @@ -30703,21 +30740,24 @@ components: required: - found _common:InlineScript: - allOf: - - $ref: '#/components/schemas/_common:ScriptBase' - - type: object - properties: - lang: - $ref: '#/components/schemas/_common:ScriptLanguage' - options: - type: object - additionalProperties: - type: string - source: - description: The script source. - type: string - required: - - source + oneOf: + - title: source + type: string + - allOf: + - $ref: '#/components/schemas/_common:ScriptBase' + - type: object + properties: + lang: + $ref: '#/components/schemas/_common:ScriptLanguage' + options: + type: object + additionalProperties: + type: string + source: + description: The script source. + type: string + required: + - source _common:Ip: type: string _common:KnnField: @@ -30726,36 +30766,42 @@ components: vector: $ref: '#/components/schemas/_common:QueryVector' k: - description: The final number of nearest neighbors to return as top hits. - type: number + description: The total number of nearest neighbors to return as top hits. + type: integer + format: int32 min_score: - description: The minimum similarity score for a neighbor to be considered a hit. + description: The minimum similarity score required in order for a neighbor to be considered a hit. type: number + format: float x-version-added: '2.14' max_distance: - description: The maximum physical distance in vector space for a neighbor to be considered a hit. + description: The maximum physical vector space distance required in order for a neighbor to be considered a hit. type: number + format: float x-version-added: '2.14' filter: - description: Filters for the kNN search query. + description: The filters for the k-NN search query. oneOf: - $ref: '#/components/schemas/_common.query_dsl:QueryContainer' - type: array items: $ref: '#/components/schemas/_common.query_dsl:QueryContainer' boost: - description: Boost value to apply to kNN scores + description: The boost value applied to k-NN scores. type: number + format: float method_parameters: type: object x-version-added: '2.16' additionalProperties: - type: number + type: integer + format: int32 rescore: type: object x-version-added: '2.17' additionalProperties: type: number + format: float required: - vector _common:LatLonGeoLocation: @@ -30830,9 +30876,10 @@ components: type: object additionalProperties: true _common:MinimumShouldMatch: - description: The minimum number of terms that should match as integer, percentage or range. + description: The minimum number of terms that should match as an integer, percentage, or range. oneOf: - - type: number + - type: integer + format: int32 - type: string _common:MultiTermQueryRewrite: type: string @@ -30858,6 +30905,7 @@ components: $ref: '#/components/schemas/_common.query_dsl:QueryContainer' max_children: type: integer + format: int32 nested: $ref: '#/components/schemas/_common:NestedSortValue' path: @@ -30921,7 +30969,7 @@ components: - master deprecated: true x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager' instead. + x-deprecation-message: Use 'cluster_manager' instead. - type: string enum: - cluster_manager @@ -30973,13 +31021,13 @@ components: items: $ref: '#/components/schemas/_common:ErrorCause' total: - description: Total number of nodes selected by the request. + description: The total number of nodes selected by the request. type: integer successful: - description: Number of nodes that responded successfully to the request. + description: The number of nodes that responded successfully to the request. type: integer failed: - description: Number of nodes that rejected the request or failed to respond. If this value is not 0, a reason for the rejection or failure is included in the response. + description: The number of nodes that rejected the request or failed to respond. If this value is not 0, then a reason for the rejection or failure is included in the response. type: integer required: - failed @@ -31027,6 +31075,7 @@ components: type: string _common:PercentageNumber: type: number + format: double _common:PercentageString: type: string pattern: \d+(\.\d+)? @@ -31056,8 +31105,8 @@ components: type: string _common:PipeSeparatedFlagsSimpleQueryStringFlag: description: |- - A set of flags that can be represented as a single enum value or a set of values that are encoded - as a pipe-separated string + A set of flags represented as a single enum value or a set of values that are encoded + as a pipe-separated string. Depending on the target language, code generators can use this hint to generate language specific flags enum constructs and the corresponding (de-)serialization code. @@ -31105,28 +31154,28 @@ components: properties: cache_count: description: |- - Total number of entries added to the query cache across all shards assigned to selected nodes. - This number includes current and evicted entries. + The total number of entries added to the query cache across all shards assigned to the selected nodes. + This number includes all current and evicted entries. type: number cache_size: - description: Total number of entries currently in the query cache across all shards assigned to selected nodes. + description: The total number of entries currently stored in the query cache across all shards assigned to the selected nodes. type: number evictions: - description: Total number of query cache evictions across all shards assigned to selected nodes. + description: The total number of query cache evictions across all shards assigned to the selected nodes. type: number hit_count: - description: Total count of query cache hits across all shards assigned to selected nodes. + description: The total number of query cache hits across all shards assigned to the selected nodes. type: number memory_size: $ref: '#/components/schemas/_common:HumanReadableByteCount' memory_size_in_bytes: - description: Total amount, in bytes, of memory used for the query cache across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used for the query cache across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' miss_count: - description: Total count of query cache misses across all shards assigned to selected nodes. + description: The total number of query cache misses across all shards assigned to the selected nodes. type: number total_count: - description: Total count of hits and misses in the query cache across all shards assigned to selected nodes. + description: The total number of hits and misses stored in the query cache across all shards assigned to the selected nodes. type: number required: - cache_count @@ -31140,6 +31189,7 @@ components: type: array items: type: number + format: float _common:RankBase: type: object _common:RankContainer: @@ -31207,10 +31257,10 @@ components: description: Statistics related to downloads to the remote segment store. properties: total_download_size: - description: The total amount of data download from the remote segment store. + description: The total amount of data downloaded from the remote segment store. $ref: '#/components/schemas/_common:RemoteStoreUploadDownloadStats' total_time_spent: - description: The total duration, spent on downloads from the remote segment store. + description: The total amount of time spent on downloads from the remote segment store. $ref: '#/components/schemas/_common:Duration' total_time_spent_in_millis: description: The total duration, in milliseconds, spent on downloads from the remote segment store. @@ -31220,7 +31270,7 @@ components: - total_time_spent_in_millis _common:RemoteStoreStats: type: object - description: Statistics about remote segment store operations. + description: Statistics related to remote segment store operations. properties: upload: $ref: '#/components/schemas/_common:RemoteStoreUploadStats' @@ -31295,10 +31345,10 @@ components: description: The amount of data, in bytes, uploaded or downloaded to/from the remote segment store. properties: failed: - description: The number of bytes that failed to upload/upload to/from the remote segment store. + description: The number of bytes that failed to upload to/from the remote segment store. $ref: '#/components/schemas/_common:HumanReadableByteCount' failed_bytes: - description: The number of bytes that failed to upload/upload to/from the remote segment store. + description: The number of bytes that failed to upload to/from the remote segment store. $ref: '#/components/schemas/_common:ByteCount' started: description: The number of bytes to upload/download to/from the remote segment store after the upload/download has started. @@ -31359,7 +31409,7 @@ components: refresh_size_lag: $ref: '#/components/schemas/_common:RemoteStoreUploadRefreshSizeLagStats' total_time_spent: - description: The total amount of time, spent on uploads to the remote segment store. + description: The total amount of time spent on uploads to the remote segment store. $ref: '#/components/schemas/_common:Duration' total_time_spent_in_millis: description: The total amount of time, in milliseconds, spent on uploads to the remote segment store. @@ -31426,6 +31476,8 @@ components: - bulk - search _common:Routing: + type: string + _common:RoutingInQueryString: oneOf: - type: string - type: array @@ -31437,10 +31489,10 @@ components: - type: object properties: rank_constant: - description: How much influence documents in individual result sets per query have over the final ranked result set + description: To what degree documents found in individual result sets per query influence the final ranked result set. type: number window_size: - description: Size of the individual result sets per query + description: The size of the individual result sets per query. type: number _common:ScheduleTimeOfDay: description: A time of day, expressed either as `hh:mm`, `noon`, `midnight`, or an hour/minutes structure. @@ -31463,8 +31515,8 @@ components: properties: params: description: |- - Specifies any named parameters that are passed into the script as variables. - Use parameters instead of hard-coded values to decrease compile time. + Specifies any named parameters that are passed into the script as variables. + Use parameters instead of hard-coded values to decrease compilation time. type: object additionalProperties: true _common:ScriptField: @@ -31477,12 +31529,11 @@ components: required: - script _common:ScriptLanguage: - type: string - enum: - - expression - - java - - mustache - - painless + anyOf: + - title: builtin + $ref: '#/components/schemas/_common:BuiltinScriptLanguage' + - title: custom + type: string _common:ScriptSort: type: object properties: @@ -31537,39 +31588,39 @@ components: description: The number of open search contexts. type: number query_current: - description: The number of shard query operations that are currently running. + description: The number of currently running shard query operations. type: number query_time: - description: The total amount of time for all shard query operations. + description: The total amount of time taken to complete all shard query operations. $ref: '#/components/schemas/_common:Duration' query_time_in_millis: - description: The total amount of time for all shard query operations, in milliseconds. + description: The total amount of time taken to complete all shard query operations, in milliseconds. $ref: '#/components/schemas/_common:DurationValueUnitMillis' query_total: description: The total number of shard query operations. type: number concurrent_query_total: - description: The total number of query operations that use concurrent segment search. + description: The total number of query operations using concurrent segment search. type: number concurrent_query_time: $ref: '#/components/schemas/_common:Duration' concurrent_query_time_in_millis: - description: The total amount of time taken by all query operations that use concurrent segment search, in milliseconds. + description: The total amount of time taken by all query operations using concurrent segment search, in milliseconds. $ref: '#/components/schemas/_common:DurationValueUnitMillis' concurrent_query_current: - description: The number of currently running query operations that use concurrent segment search. + description: The number of currently running query operations using concurrent segment search. type: number concurrent_avg_slice_count: description: The average slice count of all search requests. This is computed as the total slice count divided by the total number of concurrent search requests. type: number fetch_current: - description: The number of shard fetch operations that are currently running. + description: The number of currently running shard fetch operations. type: number fetch_time: - description: The total amount of time for all shard fetch operations. + description: The total amount of time taken to complete all shard fetch operations. $ref: '#/components/schemas/_common:Duration' fetch_time_in_millis: - description: The total amount of time for all shard fetch operations, in milliseconds. + description: The total amount of time taken to complete all shard fetch operations, in milliseconds. $ref: '#/components/schemas/_common:DurationValueUnitMillis' fetch_total: description: The total number of shard fetch operations. @@ -31578,16 +31629,16 @@ components: description: The number of shard scroll operations that are currently running. type: number scroll_time: - description: The total amount of time for all shard scroll operations. + description: The total amount of time taken to complete all shard scroll operations. $ref: '#/components/schemas/_common:Duration' scroll_time_in_millis: - description: The total amount of time for all shard scroll operations, in milliseconds. + description: The total amount of time taken to complete all shard scroll operations, in milliseconds. $ref: '#/components/schemas/_common:DurationValueUnitMillis' scroll_total: description: The total number of shard scroll operations. type: number point_in_time_total: - description: The total number of shard Point in Time (PIT) contexts that have been created (completed and active) since the node last restarted. + description: The total number of shard Point in Time (PIT) contexts created (completed and active) since the node last restarted. type: number point_in_time_time: $ref: '#/components/schemas/_common:Duration' @@ -31595,16 +31646,16 @@ components: description: The amount of time that shard PIT contexts have been held open since the node last restarted, in milliseconds. $ref: '#/components/schemas/_common:DurationValueUnitMillis' point_in_time_current: - description: The number of shard PIT contexts currently open. + description: The number of currently open shard PIT contexts. type: number suggest_current: - description: The number of shard suggest operations that are currently running. + description: The number of currently running shard suggest operations. type: number suggest_time: - description: The total amount of time for all shard suggest operations. + description: The total amount of time take to complete all shard suggest operations. $ref: '#/components/schemas/_common:Duration' suggest_time_in_millis: - description: The total amount of time for all shard suggest operations, in milliseconds. + description: The total amount of time taken to complete all shard suggest operations, in milliseconds. $ref: '#/components/schemas/_common:DurationValueUnitMillis' suggest_total: description: The total number of shard suggest operations. @@ -31613,7 +31664,7 @@ components: type: number request: type: object - description: Statistics about coordinator search operations for the node. + description: Statistics related to coordinator search operations for the node. additionalProperties: $ref: '#/components/schemas/_common:RequestStats' groups: @@ -31655,12 +31706,12 @@ components: type: object properties: count: - description: Total number of segments across all shards assigned to selected nodes. + description: The total number of segments across all shards assigned to the selected nodes. type: number doc_values_memory: $ref: '#/components/schemas/_common:HumanReadableByteCount' doc_values_memory_in_bytes: - description: Total amount, in bytes, of memory used for doc values across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used for document values across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' file_sizes: description: |- @@ -31672,59 +31723,59 @@ components: fixed_bit_set: $ref: '#/components/schemas/_common:HumanReadableByteCount' fixed_bit_set_memory_in_bytes: - description: Total amount of memory, in bytes, used by fixed bit sets across all shards assigned to selected nodes. + description: The total amount of memory, in bytes, used by fixed bit sets across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' index_writer_memory: $ref: '#/components/schemas/_common:HumanReadableByteCount' index_writer_max_memory_in_bytes: $ref: '#/components/schemas/_common:ByteCount' index_writer_memory_in_bytes: - description: Total amount, in bytes, of memory used by all index writers across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used by all index writers across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' max_unsafe_auto_id_timestamp: - description: Unix timestamp, in milliseconds, of the most recently retried indexing request. + description: The Unix timestamp, in milliseconds, of the most recently retried indexing request. type: number memory: - description: Total amount, of memory used for segments across all shards assigned to selected nodes. + description: The total amount of memory used for segments across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:HumanReadableByteCount' memory_in_bytes: - description: Total amount, in bytes, of memory used for segments across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used for segments across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' norms_memory: - description: Total amount of memory used for normalization factors across all shards assigned to selected nodes. + description: The total amount of memory used for normalization factors across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:HumanReadableByteCount' norms_memory_in_bytes: - description: Total amount, in bytes, of memory used for normalization factors across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used for normalization factors across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' points_memory: - description: Total amount of memory used for points across all shards assigned to selected nodes. + description: The total amount of memory used for points across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:HumanReadableByteCount' points_memory_in_bytes: - description: Total amount, in bytes, of memory used for points across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used for points across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' stored_fields_memory: - description: Total amount of memory used for stored fields across all shards assigned to selected nodes. + description: The total amount of memory used for stored fields across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:HumanReadableByteCount' stored_fields_memory_in_bytes: - description: Total amount, in bytes, of memory used for stored fields across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used for stored fields across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' terms_memory: - description: Total amount of memory used for terms across all shards assigned to selected nodes. + description: The total amount of memory used for terms across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:HumanReadableByteCount' terms_memory_in_bytes: - description: Total amount, in bytes, of memory used for terms across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used for terms across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' term_vectors_memory: - description: Total amount of memory used for term vectors across all shards assigned to selected nodes. + description: The total amount of memory used for term vectors across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:HumanReadableByteCount' term_vectors_memory_in_bytes: - description: Total amount, in bytes, of memory used for term vectors across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used for term vectors across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' version_map_memory: - description: Total amount of memory used by all version maps across all shards assigned to selected nodes. + description: The total amount of memory used by all version maps across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:HumanReadableByteCount' version_map_memory_in_bytes: - description: Total amount, in bytes, of memory used by all version maps across all shards assigned to selected nodes. + description: The total amount, in bytes, of memory used by all version maps across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' remote_store: $ref: '#/components/schemas/_common:RemoteStoreStats' @@ -31799,12 +31850,13 @@ components: id: $ref: '#/components/schemas/_common:Id' max: - type: number + type: integer + format: int32 required: - id - max _common:Slices: - description: Slices configuration used to parallelize a process. + description: The slice configuration used to parallelize a process. oneOf: - type: number - $ref: '#/components/schemas/_common:SlicesCalculation' @@ -31886,7 +31938,7 @@ components: size: $ref: '#/components/schemas/_common:HumanReadableByteCount' size_in_bytes: - description: Total size, in bytes, of all shards assigned to selected nodes. + description: The total size, in bytes, of all shards assigned to the selected nodes. $ref: '#/components/schemas/_common:ByteCount' reserved: $ref: '#/components/schemas/_common:HumanReadableByteCount' @@ -31898,8 +31950,8 @@ components: - size_in_bytes _common:Stringifiedboolean: description: |- - 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. + Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures + 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. @@ -31908,8 +31960,8 @@ components: - type: string _common:StringifiedEpochTimeUnitMillis: description: |- - 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. + Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures + 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. @@ -31918,8 +31970,8 @@ components: - type: string _common:StringifiedEpochTimeUnitSeconds: description: |- - 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. + Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures + 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. @@ -31928,8 +31980,8 @@ components: - type: string _common:Stringifiedinteger: description: |- - 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. + Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures + 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. @@ -31938,8 +31990,8 @@ components: - type: string _common:StringifiedVersionNumber: description: |- - 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. + Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures + 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. @@ -32050,7 +32102,7 @@ components: _common:ulong: type: number _common:UnitMillis: - description: Time unit for milliseconds. + description: The time unit for milliseconds. type: integer format: int64 _common:UnitNanos: @@ -32081,8 +32133,8 @@ components: description: |- The absence of any type. This is commonly used in APIs that don't return a body. - Although "void" is generally used for the unit type that has only one value, this is to be interpreted as - the bottom type that has no value at all. Most languages have a unit type, but few have a bottom type. + Although "void" is generally used for a unit type that has only one value, this is interpreted as + the bottom type, which has no value. Most languages have a unit type, but few have a bottom type. See https://en.m.wikipedia.org/wiki/Unit_type and https://en.m.wikipedia.org/wiki/Bottom_type. type: object @@ -32163,19 +32215,21 @@ components: x: description: The x coordinate. type: number + format: double 'y': description: The y coordinate. type: number + format: double required: - x - 'y' _common:XyLocation: x-version-added: '2.4' description: |- - A two-dimensional Cartesian point specified by x and y coordinates. It can be represented in various ways: - - as a `{x, y}` object - - as a `[x, y]` array - - as a string in `"x, y"` or WKT point formats. + A two-dimensional Cartesian point specified by x and y coordinates. It can be represented in the following ways: + - As an `{x, y}` object. + - As an `[x, y]` array. + - As a string in `"x, y"` or WKT point format. oneOf: - title: cartesian $ref: '#/components/schemas/_common:XyCartesianCoordinates' @@ -32183,6 +32237,7 @@ components: type: array items: type: number + format: double - title: text type: string _common.aggregations:AdjacencyMatrixAggregate: @@ -40665,7 +40720,8 @@ components: description: Can only be used as a clause in a span_near query. type: object additionalProperties: - type: number + type: integer + format: int32 minProperties: 1 maxProperties: 1 _common.query_dsl:SpanMultiTermQuery: @@ -41015,7 +41071,8 @@ components: routing: $ref: '#/components/schemas/_common:Routing' if_primary_term: - type: number + type: integer + format: int64 if_seq_no: $ref: '#/components/schemas/_common:SequenceNumber' version: @@ -41054,12 +41111,14 @@ components: type: string status: description: HTTP status code returned for the operation. - type: number + type: integer + format: int32 error: $ref: '#/components/schemas/_common:ErrorCause' _primary_term: description: The primary term assigned to the document for the operation. - type: number + type: integer + format: int64 result: description: |- Result of the operation. @@ -41113,7 +41172,8 @@ components: description: When `true`, the request's actions must target an index alias. type: boolean retry_on_conflict: - type: number + type: integer + format: int32 _core.bulk:WriteOperation: allOf: - $ref: '#/components/schemas/_core.bulk:OperationBase' @@ -41146,7 +41206,15 @@ components: items: $ref: '#/components/schemas/_core.explain:ExplanationDetail' value: - type: number + oneOf: + - type: integer + format: int32 + - type: integer + format: int64 + - type: number + format: float + - type: number + format: double required: - description - details @@ -41161,7 +41229,15 @@ components: items: $ref: '#/components/schemas/_core.explain:ExplanationDetail' value: - type: number + oneOf: + - type: integer + format: int32 + - type: integer + format: int64 + - type: number + format: float + - type: number + format: double required: - description - value @@ -41169,7 +41245,7 @@ components: type: object properties: aggregatable: - description: Whether this field can be aggregated on all indices. + description: Whether this field can be aggregated on all indexes. type: boolean indices: $ref: '#/components/schemas/_common:Indices' @@ -41180,7 +41256,7 @@ components: non_searchable_indices: $ref: '#/components/schemas/_common:Indices' searchable: - description: Whether this field is indexed for search on all indices. + description: Whether this field is indexed for search on all indexes. type: boolean type: type: string @@ -41194,15 +41270,15 @@ components: $ref: '#/components/schemas/_common.mapping:TimeSeriesMetricType' non_dimension_indices: description: |- - If this list is present in response then some indices have the - field marked as a dimension and other indices, the ones in this list, do not. + If this list is present in the response, then indexes not contained in the list have the + field marked as a dimension. Any indexes contained in the list are not marked as a dimension. type: array items: $ref: '#/components/schemas/_common:IndexName' metric_conflicts_indices: description: |- - The list of indices where this field is present if these indices - don't have the same `time_series_metric` value for this field. + The list of indexes in which this field is present if the indexes + don't have the same `time_series_metric` value for the field. type: array items: $ref: '#/components/schemas/_common:IndexName' @@ -41332,25 +41408,25 @@ components: type: object properties: explain: - description: If `true`, returns detailed information about score calculation as part of each hit. + description: When `true`, returns detailed information about score calculation as part of each hit. type: boolean id: $ref: '#/components/schemas/_common:Id' params: description: |- - Key-value pairs used to replace Mustache variables in the template. + The key-value pairs used to replace Mustache variables in the template. The key is the variable name. The value is the variable value. type: object additionalProperties: type: object profile: - description: If `true`, the query execution is profiled. + description: When `true`, provides a profile for the query execution. type: boolean source: description: |- - An inline search template. Supports the same parameters as the search API's - request body. Also supports Mustache variables. If no id is specified, this + An inline search template that supports the same parameters as the Search API's + request body and Mustache variables. If no `id` is specified, this parameter is required. type: string _core.msearch:MultisearchBody: @@ -41365,10 +41441,10 @@ components: query: $ref: '#/components/schemas/_common.query_dsl:QueryContainer' explain: - description: If true, returns detailed information about score computation as part of a hit. + description: When `true`, returns detailed information about score computation as part of a hit. type: boolean ext: - description: Configuration of search extensions defined by OpenSearch plugins. + description: The configuration of search extensions defined by OpenSearch plugins. type: object additionalProperties: type: object @@ -41376,8 +41452,8 @@ components: $ref: '#/components/schemas/_common:Fields' docvalue_fields: description: |- - Array of wildcard (*) patterns. The request returns doc values for field - names matching these patterns in the hits.fields property of the response. + An array of wildcard (*) patterns. The request returns document values for field + names matching these patterns in the `hits.fields` property of the response. type: array items: $ref: '#/components/schemas/_common.query_dsl:FieldAndFormat' @@ -41390,14 +41466,14 @@ components: $ref: '#/components/schemas/_common.query_dsl:KnnQuery' from: description: |- - Starting document offset. By default, you cannot page through more than 10,000 - hits using the from and size parameters. To page through more hits, use the - search_after parameter. + The starting document offset. By default, you cannot page through more than 10,000 + hits using the `from` and `size` parameters. To page through more than 10,000 hits, use the + `search_after` parameter. type: number highlight: $ref: '#/components/schemas/_core.search:Highlight' indices_boost: - description: Boosts the _score of documents from specified indices. + description: Boosts the `_score` of documents from the specified indexes. type: array items: type: object @@ -41405,8 +41481,8 @@ components: type: number min_score: description: |- - Minimum _score for matching documents. Documents with a lower _score are - not included in the search results. + The minimum `_score` for document matching. Documents with a lower `_score` than the minimum + are not included in the search results. type: number post_filter: $ref: '#/components/schemas/_common.query_dsl:QueryContainer' @@ -41419,7 +41495,7 @@ components: items: $ref: '#/components/schemas/_core.search:Rescore' script_fields: - description: Retrieve a script evaluation (based on different fields) for each hit. + description: Retrieves a script evaluation (based on different fields) for each hit. type: object additionalProperties: $ref: '#/components/schemas/_common:ScriptField' @@ -41428,8 +41504,8 @@ components: size: description: |- 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 - hits, use the search_after parameter. + than 10,000 hits using the `from` and `size` parameters. To page through more + hits, use the `search_after` parameter. type: number sort: $ref: '#/components/schemas/_common:Sort' @@ -41437,22 +41513,22 @@ components: $ref: '#/components/schemas/_core.search:SourceConfig' fields: description: |- - Array of wildcard (*) patterns. The request returns values for field names - matching these patterns in the hits.fields property of the response. + An array of wildcard (*) patterns. The request returns values for field names + matching these patterns in the `hits.fields` property of the response. type: array items: $ref: '#/components/schemas/_common.query_dsl:FieldAndFormat' terminate_after: description: |- - Maximum number of documents to collect for each shard. If a query reaches this - limit, OpenSearch terminates the query early. OpenSearch collects documents - before sorting. Defaults to 0, which does not terminate query execution early. + The maximum number of documents to collect for each shard. If a query reaches this + limit, OpenSearch stops the query early. OpenSearch collects documents + before sorting. Default is `0`, which does not terminate query execution early. type: number stats: description: |- - Stats groups to associate with the search. Each group maintains a statistics - aggregation for its associated searches. You can retrieve these stats using - the indices stats API. + The statistics groups to associate with the search. Each group maintains a statistics + aggregation for its associated searches. You can retrieve these statistics using + the Index Stats API. type: array items: type: string @@ -41460,21 +41536,21 @@ components: description: |- Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. - Defaults to no timeout. + Default is no timeout. type: string track_scores: - description: If true, calculate and return document scores, even if the scores are not used for sorting. + description: When `true`, calculates and returns all document scores, even if the scores are not used for sorting. type: boolean track_total_hits: $ref: '#/components/schemas/_core.search:TrackHits' version: - description: If true, returns document version as part of a hit. + description: When `true`, returns the document version as part of the hit. type: boolean runtime_mappings: $ref: '#/components/schemas/_common.mapping:RuntimeFields' seq_no_primary_term: description: |- - If true, returns sequence number and primary term of the last modification + When `true`, returns the sequence number and primary term of the last modification. of each hit. See Optimistic concurrency control. type: boolean pit: @@ -41541,28 +41617,28 @@ components: _index: $ref: '#/components/schemas/_common:IndexName' doc: - description: An artificial document (a document not present in the index) for which you want to retrieve term vectors. + description: An artificial document for which you want to retrieve term vectors. type: object fields: $ref: '#/components/schemas/_common:Fields' field_statistics: - description: If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. + description: When `true`, the response includes the document count, the sum of the document frequencies, and the sum of the term frequencies. type: boolean filter: $ref: '#/components/schemas/_core.termvectors:Filter' offsets: - description: If `true`, the response includes term offsets. + description: When `true`, the response includes the term offsets. type: boolean payloads: - description: If `true`, the response includes term payloads. + description: When `true`, the response includes the term payloads. type: boolean positions: - description: If `true`, the response includes term positions. + description: When `true`, the response includes the term positions. type: boolean routing: $ref: '#/components/schemas/_common:Routing' term_statistics: - description: If true, the response includes term frequency and document frequency. + description: When `true`, the response includes the term frequency and the document frequency. type: boolean version: $ref: '#/components/schemas/_common:VersionNumber' @@ -41600,7 +41676,7 @@ components: _index: $ref: '#/components/schemas/_common:IndexName' rating: - description: The document's relevance with regard to this search request. + description: The document's relevance with regard to the specified search request. type: number required: - _id @@ -41648,26 +41724,26 @@ components: type: object properties: k: - description: Sets the maximum number of documents retrieved per query. This value will act in place of the usual size parameter in the query. + description: Sets the maximum number of documents retrieved per query. This value replaces the usual `size` parameter in the query. type: number _core.rank_eval:RankEvalMetricDetail: type: object properties: metric_score: - description: The metric_score in the details section shows the contribution of this query to the global quality metric score + description: The `metric_score`, found in the `metric_details` section, shows the contribution of this query to the global quality metric score. type: number unrated_docs: - description: The unrated_docs section contains an _index and _id entry for each document in the search result for this query that didn't have a ratings value. This can be used to ask the user to supply ratings for these documents + description: The `unrated_docs` section contains an `_index` and `_id` entry for each document that didn't have a ratings value. This can be used to ask the user to supply ratings for these documents. type: array items: $ref: '#/components/schemas/_core.rank_eval:UnratedDocument' hits: - description: The hits section shows a grouping of the search results with their supplied ratings + description: The `hits` section shows a grouping of the search results with their supplied ratings type: array items: $ref: '#/components/schemas/_core.rank_eval:RankEvalHitItem' metric_details: - description: The metric_details give additional information about the calculated quality metric (e.g. how many of the retrieved documents were relevant). The content varies for each metric but allows for better interpretation of the results + description: The `metric_details` section gives additional information about the calculated quality metric, in other words, how many of the retrieved documents were relevant. The content varies for each metric but allows for better interpretation of the results. type: object additionalProperties: type: object @@ -41684,7 +41760,7 @@ components: - type: object properties: normalize: - description: If set to true, this metric will calculate the Normalized DCG (https://en.wikipedia.org/wiki/Discounted_cumulative_gain#Normalized_DCG). + description: When `true`, this metric calculates the Normalized DCG (https://en.wikipedia.org/wiki/Discounted_cumulative_gain#Normalized_DCG). type: boolean _core.rank_eval:RankEvalMetricExpectedReciprocalRank: allOf: @@ -41706,7 +41782,7 @@ components: - type: object properties: ignore_unlabeled: - description: Controls how unlabeled documents in the search results are counted. If set to true, unlabeled documents are ignored and neither count as relevant or irrelevant. Set to false (the default), they are treated as irrelevant. + description: Controls how unlabeled documents in the search results are counted. When `true`, unlabeled documents are ignored and do not count as relevant or irrelevant. When `false`, unlabeled documents are treated as irrelevant. type: boolean _core.rank_eval:RankEvalMetricRatingThreshold: allOf: @@ -41714,7 +41790,7 @@ components: - type: object properties: relevant_rating_threshold: - description: Sets the rating threshold above which documents are considered to be "relevant". + description: Sets the rating threshold above which documents are considered to be relevant. type: number _core.rank_eval:RankEvalMetricRecall: allOf: @@ -41737,7 +41813,7 @@ components: request: $ref: '#/components/schemas/_core.rank_eval:RankEvalQuery' ratings: - description: List of document ratings + description: A list of document ratings. type: array items: $ref: '#/components/schemas/_core.rank_eval:DocumentRating' @@ -41942,29 +42018,41 @@ components: type: object properties: build_aggregation: - type: number + type: integer + format: int64 build_aggregation_count: - type: number + type: integer + format: int64 build_leaf_collector: - type: number + type: integer + format: int64 build_leaf_collector_count: - type: number + type: integer + format: int64 collect: - type: number + type: integer + format: int64 collect_count: - type: number + type: integer + format: int64 initialize: - type: number + type: integer + format: int64 initialize_count: - type: number + type: integer + format: int64 post_collection: - type: number + type: integer + format: int64 post_collection_count: - type: number + type: integer + format: int64 reduce: - type: number + type: integer + format: int64 reduce_count: - type: number + type: integer + format: int64 required: - build_aggregation - build_aggregation_count @@ -42002,15 +42090,19 @@ components: type: object properties: segments_with_multi_valued_ords: - type: number + type: integer + format: int32 collection_strategy: type: string segments_with_single_valued_ords: - type: number + type: integer + format: int32 total_buckets: - type: number + type: integer + format: int32 built_buckets: - type: number + type: integer + format: int32 result_strategy: type: string has_filter: @@ -42020,58 +42112,76 @@ components: delegate_debug: $ref: '#/components/schemas/_core.search:AggregationProfileDebug' chars_fetched: - type: number + type: integer + format: int32 extract_count: - type: number + type: integer + format: int32 extract_ns: - type: number + type: integer + format: int32 values_fetched: - type: number + type: integer + format: int32 collect_analyzed_ns: - type: number + type: integer + format: int32 collect_analyzed_count: - type: number + type: integer + format: int32 surviving_buckets: - type: number + type: integer + format: int32 ordinals_collectors_used: - type: number + type: integer + format: int32 ordinals_collectors_overhead_too_high: - type: number + type: integer + format: int32 string_hashing_collectors_used: - type: number + type: integer + format: int32 numeric_collectors_used: - type: number + type: integer + format: int32 empty_collectors_used: - type: number + type: integer + format: int32 deferred_aggregators: type: array items: type: string segments_with_doc_count_field: - type: number + type: integer + format: int32 segments_with_deleted_docs: - type: number + type: integer + format: int32 filters: type: array items: $ref: '#/components/schemas/_core.search:AggregationProfileDelegateDebugFilter' segments_counted: - type: number + type: integer + format: int32 segments_collected: - type: number + type: integer + format: int32 map_reducer: type: string _core.search:AggregationProfileDelegateDebugFilter: type: object properties: results_from_metadata: - type: number + type: integer + format: int32 query: type: string specialized_for: type: string segments_counted_in_constant_time: - type: number + type: integer + format: int32 _core.search:BoundaryScanner: type: string enum: @@ -42137,12 +42247,14 @@ components: $ref: '#/components/schemas/_common:Routing' _score: type: number + format: float _source: type: object text: type: string score: type: number + format: float required: - text _core.search:Context: @@ -42180,17 +42292,23 @@ components: load_source_count: type: number load_stored_fields: - type: number + type: integer + format: int32 load_stored_fields_count: - type: number + type: integer + format: int32 next_reader: - type: number + type: integer + format: int32 next_reader_count: - type: number + type: integer + format: int32 process_count: - type: number + type: integer + format: int32 process: - type: number + type: integer + format: int32 _core.search:FetchProfileDebug: type: object properties: @@ -42199,7 +42317,8 @@ components: items: type: string fast_path: - type: number + type: integer + format: int32 _core.search:FieldCollapse: type: object properties: @@ -42240,7 +42359,8 @@ components: type: string boundary_max_scan: description: How far to scan for boundary characters. - type: number + type: integer + format: int32 boundary_scanner: $ref: '#/components/schemas/_core.search:BoundaryScanner' boundary_scanner_locale: @@ -42255,22 +42375,26 @@ components: $ref: '#/components/schemas/_core.search:HighlighterFragmenter' fragment_size: description: The size of the highlighted fragment in characters. - type: number + type: integer + format: int32 highlight_filter: type: boolean highlight_query: $ref: '#/components/schemas/_common.query_dsl:QueryContainer' max_fragment_length: - type: number + type: integer + format: int32 max_analyzed_offset: description: |- If set to a non-negative value, highlighting stops at this defined maximum limit. The rest of the text is not processed, thus not highlighted and no error is returned The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it's set to lower value than the query setting. - type: number + type: integer + format: int32 no_match_size: description: The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. - type: number + type: integer + format: int32 number_of_fragments: description: |- The maximum number of fragments to return. @@ -42278,7 +42402,8 @@ components: Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. If `number_of_fragments` is `0`, `fragment_size` is ignored. - type: number + type: integer + format: int32 options: type: object additionalProperties: @@ -42291,7 +42416,8 @@ components: Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory. When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by the `fvh` highlighter. - type: number + type: integer + format: int32 post_tags: description: |- Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text. @@ -42343,7 +42469,8 @@ components: - type: object properties: fragment_offset: - type: number + type: integer + format: int32 matched_fields: $ref: '#/components/schemas/_common:Fields' analyzer: @@ -42405,7 +42532,8 @@ components: _seq_no: $ref: '#/components/schemas/_common:SequenceNumber' _primary_term: - type: number + type: integer + format: int64 _version: $ref: '#/components/schemas/_common:VersionNumber' sort: @@ -42420,7 +42548,8 @@ components: description: Total hit count information, present only if `track_total_hits` wasn't `false` in the search request. oneOf: - $ref: '#/components/schemas/_core.search:TotalHits' - - type: number + - type: integer + format: int64 hits: type: array items: @@ -42440,9 +42569,11 @@ components: size: description: The maximum number of hits to return per `inner_hits`. type: integer + format: int32 from: description: Inner hit starting document offset. type: integer + format: int32 collapse: $ref: '#/components/schemas/_core.search:FieldCollapse' docvalue_fields: @@ -42486,7 +42617,8 @@ components: field: $ref: '#/components/schemas/_common:Field' offset: - type: number + type: integer + format: int32 _nested: $ref: '#/components/schemas/_core.search:NestedIdentity' required: @@ -42512,6 +42644,7 @@ components: type: string score: type: number + format: float highlighted: type: string collate_match: @@ -42541,41 +42674,59 @@ components: type: object properties: advance: - type: number + type: integer + format: int64 advance_count: - type: number + type: integer + format: int64 build_scorer: - type: number + type: integer + format: int64 build_scorer_count: - type: number + type: integer + format: int64 create_weight: - type: number + type: integer + format: int64 create_weight_count: - type: number + type: integer + format: int64 match: - type: number + type: integer + format: int64 match_count: - type: number + type: integer + format: int64 shallow_advance: - type: number + type: integer + format: int64 shallow_advance_count: - type: number + type: integer + format: int64 next_doc: - type: number + type: integer + format: int64 next_doc_count: - type: number + type: integer + format: int64 score: - type: number + type: integer + format: int64 score_count: - type: number + type: integer + format: int64 compute_max_score: - type: number + type: integer + format: int64 compute_max_score_count: - type: number + type: integer + format: int64 set_min_competitive_score: - type: number + type: integer + format: int64 set_min_competitive_score_count: - type: number + type: integer + format: int64 required: - advance - advance_count @@ -42621,7 +42772,8 @@ components: query: $ref: '#/components/schemas/_core.search:RescoreQuery' window_size: - type: number + type: integer + format: int32 required: - query _core.search:RescoreQuery: @@ -42632,9 +42784,11 @@ components: query_weight: description: Relative importance of the original query versus the rescore query. type: number + format: float rescore_query_weight: description: Relative importance of the rescore query versus the original query. type: number + format: float score_mode: $ref: '#/components/schemas/_core.search:ScoreMode' required: @@ -42643,7 +42797,8 @@ components: type: object properties: took: - type: number + type: integer + format: int64 timed_out: type: boolean _shards: @@ -42665,8 +42820,10 @@ components: type: object max_score: type: number + format: float num_reduce_phases: - type: number + type: integer + format: int32 profile: $ref: '#/components/schemas/_core.search:Profile' pit_id: @@ -42706,7 +42863,8 @@ components: items: $ref: '#/components/schemas/_core.search:QueryProfile' rewrite_time: - type: number + type: integer + format: int64 required: - collector - query @@ -42764,9 +42922,11 @@ components: type: object properties: length: - type: number + type: integer + format: int32 offset: - type: number + type: integer + format: int32 text: type: string required: @@ -42799,8 +42959,10 @@ components: type: string score: type: number + format: float freq: type: number + format: double highlighted: type: string collate_match: @@ -42815,7 +42977,8 @@ components: relation: $ref: '#/components/schemas/_core.search:TotalHitsRelation' value: - type: number + type: integer + format: int64 required: - relation - value @@ -42832,7 +42995,8 @@ components: Defaults to 10,000 hits. oneOf: - type: boolean - - type: number + - type: integer + format: int32 _core.termvectors:FieldStatistics: type: object properties: @@ -43074,7 +43238,8 @@ components: When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. If set to `0` (default), the query does not terminate early. - type: number + type: integer + format: int32 timeout: description: |- Specifies the period of time to wait for a response from each shard. @@ -48585,6 +48750,18 @@ components: $ref: '#/components/schemas/_common:Uuid' index: $ref: '#/components/schemas/_common:IndexName' + isSearchableSnapshot: + type: boolean + remoteStoreIndexShallowCopy: + type: boolean + sourceRemoteStoreRepository: + type: + - 'null' + - string + sourceRemoteTranslogRepository: + type: + - 'null' + - string indices.recovery:RecoveryStartStatus: type: object properties: @@ -53219,23 +53396,14 @@ components: notifications._common:RestStatus: type: string enum: - - accepted - - continue - - created - - found - - moved_permanently - - multi_status - - multiple_choices - - no_content - - non_authoritative_information - - not_modified - - ok - - partial_content - - reset_content - - see_other - - switching_protocols - - temporary_redirect - - use_proxy + - ACCEPTED + - CREATED + - MULTI_STATUS + - NON_AUTHORITATIVE_INFORMATION + - NO_CONTENT + - OK + - PARTIAL_CONTENT + - RESET_CONTENT notifications._common:SesAccount: type: object properties: @@ -55067,31 +55235,6 @@ components: required: - file_count - size_in_bytes - snapshot._common:IndexDetails: - type: object - properties: - shard_count: - type: number - size: - $ref: '#/components/schemas/_common:HumanReadableByteCount' - size_in_bytes: - $ref: '#/components/schemas/_common:ByteCount' - max_segments_per_shard: - type: number - required: - - max_segments_per_shard - - shard_count - - size_in_bytes - snapshot._common:InfoFeatureState: - type: object - properties: - feature_name: - type: string - indices: - $ref: '#/components/schemas/_common:Indices' - required: - - feature_name - - indices snapshot._common:Repository: type: object properties: @@ -55223,16 +55366,14 @@ components: type: array items: $ref: '#/components/schemas/_common:IndexName' - index_details: - type: object - additionalProperties: - $ref: '#/components/schemas/snapshot._common:IndexDetails' metadata: $ref: '#/components/schemas/_common:Metadata' + pinned_timestamp: + $ref: '#/components/schemas/_common:EpochTimeUnitMillis' reason: type: string - repository: - $ref: '#/components/schemas/_common:Name' + remote_store_index_shallow_copy: + type: boolean snapshot: $ref: '#/components/schemas/_common:Name' shards: @@ -55249,10 +55390,6 @@ components: $ref: '#/components/schemas/_common:VersionString' version_id: $ref: '#/components/schemas/_common:VersionNumber' - feature_states: - type: array - items: - $ref: '#/components/schemas/snapshot._common:InfoFeatureState' required: - data_streams - snapshot @@ -55347,19 +55484,6 @@ components: required: - deleted_blobs - deleted_bytes - snapshot.get:SnapshotResponseItem: - type: object - properties: - repository: - $ref: '#/components/schemas/_common:Name' - snapshots: - type: array - items: - $ref: '#/components/schemas/snapshot._common:SnapshotInfo' - error: - $ref: '#/components/schemas/_common:ErrorCause' - required: - - repository snapshot.restore:SnapshotRestore: type: object properties: diff --git a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Notifications.cs b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Notifications.cs index 4632e9310d..2f6e1580b1 100644 --- a/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Notifications.cs +++ b/src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.Notifications.cs @@ -114,6 +114,20 @@ public string ChimeUrlKeyword set => Q("chime.url.keyword", value); } + /// Notification configuration ID. + public string ConfigId + { + get => Q("config_id"); + set => Q("config_id", value); + } + + /// Notification configuration IDs. + public string[] ConfigIdList + { + get => Q("config_id_list"); + set => Q("config_id_list", value); + } + /// Type of notification configuration. public NotificationsNotificationConfigType? ConfigType {