From 445c9f4cd6f98757555e603bcea0167ceb8eb4d9 Mon Sep 17 00:00:00 2001 From: achyutjhunjhunwala Date: Wed, 26 Jun 2024 15:25:42 +0200 Subject: [PATCH 1/2] Add missing type for ignore_dynamic_beyond_limit for the Indices Settings API --- output/openapi/elasticsearch-openapi.json | 4 ++ .../elasticsearch-serverless-openapi.json | 4 ++ output/schema/schema.json | 43 ++++++++++++------- output/typescript/types.ts | 1 + specification/indices/_types/IndexSettings.ts | 8 ++++ 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 13a3f63b2e..ec3062beec 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -72601,6 +72601,10 @@ "limit": { "description": "The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit.\nThe limit is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance\ndegradations and memory issues, especially in clusters with a high load or few resources.", "type": "number" + }, + "ignore_dynamic_beyond_limit": { + "description": "A flag to ignore fields beyond the limit set for the maximum number of fields in an index.\nIf set to true, fields exceeding the limit will be ignored instead of causing an error.\nThis can be useful in scenarios where the data is dynamic and, it's acceptable to overlook extra fields.\nHowever, use this setting with caution as ignoring additional fields might lead to loss of data or unexpected search results.", + "type": "boolean" } } }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index dc40dd5d37..0bf7ae82f8 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -47609,6 +47609,10 @@ "limit": { "description": "The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit.\nThe limit is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance\ndegradations and memory issues, especially in clusters with a high load or few resources.", "type": "number" + }, + "ignore_dynamic_beyond_limit": { + "description": "A flag to ignore fields beyond the limit set for the maximum number of fields in an index.\nIf set to true, fields exceeding the limit will be ignored instead of causing an error.\nThis can be useful in scenarios where the data is dynamic and, it's acceptable to overlook extra fields.\nHowever, use this setting with caution as ignoring additional fields might lead to loss of data or unexpected search results.", + "type": "boolean" } } }, diff --git a/output/schema/schema.json b/output/schema/schema.json index db526d5e1c..ee2a8c91c7 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -120913,7 +120913,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L539-L541" + "specLocation": "indices/_types/IndexSettings.ts#L547-L549" }, { "kind": "interface", @@ -120935,7 +120935,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L543-L550" + "specLocation": "indices/_types/IndexSettings.ts#L551-L558" }, { "kind": "interface", @@ -120989,7 +120989,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L552-L557" + "specLocation": "indices/_types/IndexSettings.ts#L560-L565" }, { "kind": "interface", @@ -121013,7 +121013,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L559-L566" + "specLocation": "indices/_types/IndexSettings.ts#L567-L574" }, { "kind": "enum", @@ -121159,7 +121159,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L434-L441" + "specLocation": "indices/_types/IndexSettings.ts#L442-L449" }, { "kind": "interface", @@ -121181,7 +121181,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L471-L477" + "specLocation": "indices/_types/IndexSettings.ts#L479-L485" }, { "kind": "interface", @@ -121203,7 +121203,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L462-L469" + "specLocation": "indices/_types/IndexSettings.ts#L470-L477" }, { "kind": "interface", @@ -121226,7 +121226,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L443-L451" + "specLocation": "indices/_types/IndexSettings.ts#L451-L459" }, { "kind": "interface", @@ -121249,7 +121249,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L453-L460" + "specLocation": "indices/_types/IndexSettings.ts#L461-L468" }, { "kind": "interface", @@ -121270,9 +121270,22 @@ "namespace": "_types" } } + }, + { + "description": "A flag to ignore fields beyond the limit set for the maximum number of fields in an index.\nIf set to true, fields exceeding the limit will be ignored instead of causing an error.\nThis can be useful in scenarios where the data is dynamic and, it's acceptable to overlook extra fields.\nHowever, use this setting with caution as ignoring additional fields might lead to loss of data or unexpected search results.", + "name": "ignore_dynamic_beyond_limit", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "indices/_types/IndexSettings.ts#L424-L432" + "specLocation": "indices/_types/IndexSettings.ts#L424-L440" }, { "kind": "interface", @@ -122046,7 +122059,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L479-L484" + "specLocation": "indices/_types/IndexSettings.ts#L487-L492" }, { "kind": "interface", @@ -122100,7 +122113,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L491-L496" + "specLocation": "indices/_types/IndexSettings.ts#L499-L504" }, { "kind": "interface", @@ -122132,7 +122145,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L486-L489" + "specLocation": "indices/_types/IndexSettings.ts#L494-L497" }, { "kind": "interface", @@ -122200,7 +122213,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L498-L507" + "specLocation": "indices/_types/IndexSettings.ts#L506-L515" }, { "isOpen": true, @@ -122227,7 +122240,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L509-L537" + "specLocation": "indices/_types/IndexSettings.ts#L517-L545" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 68501e98a8..2d71da7425 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -10632,6 +10632,7 @@ export interface IndicesMappingLimitSettingsNestedObjects { export interface IndicesMappingLimitSettingsTotalFields { limit?: long + ignore_dynamic_beyond_limit?: boolean } export interface IndicesMerge { diff --git a/specification/indices/_types/IndexSettings.ts b/specification/indices/_types/IndexSettings.ts index a74a613085..7a7d76b6ee 100644 --- a/specification/indices/_types/IndexSettings.ts +++ b/specification/indices/_types/IndexSettings.ts @@ -429,6 +429,14 @@ export class MappingLimitSettingsTotalFields { * @server_default 1000 */ limit?: long + /** + * A flag to ignore fields beyond the limit set for the maximum number of fields in an index. + * If set to true, fields exceeding the limit will be ignored instead of causing an error. + * This can be useful in scenarios where the data is dynamic and, it's acceptable to overlook extra fields. + * However, use this setting with caution as ignoring additional fields might lead to loss of data or unexpected search results. + * @server_default false + */ + ignore_dynamic_beyond_limit?: boolean } export class MappingLimitSettingsDepth { From a68a52797c3e8a549bda5811256e4d7ba97564d3 Mon Sep 17 00:00:00 2001 From: achyutjhunjhunwala Date: Wed, 26 Jun 2024 15:38:54 +0200 Subject: [PATCH 2/2] Update description of the field --- output/openapi/elasticsearch-openapi.json | 2 +- .../elasticsearch-serverless-openapi.json | 2 +- output/schema/schema.json | 32 +++++++++---------- specification/indices/_types/IndexSettings.ts | 9 +++--- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index ec3062beec..b20f143ed8 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -72603,7 +72603,7 @@ "type": "number" }, "ignore_dynamic_beyond_limit": { - "description": "A flag to ignore fields beyond the limit set for the maximum number of fields in an index.\nIf set to true, fields exceeding the limit will be ignored instead of causing an error.\nThis can be useful in scenarios where the data is dynamic and, it's acceptable to overlook extra fields.\nHowever, use this setting with caution as ignoring additional fields might lead to loss of data or unexpected search results.", + "description": "This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set\nto false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail\nwith the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail.\nInstead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false.\nThe fields that were not added to the mapping will be added to the _ignored field.", "type": "boolean" } } diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 0bf7ae82f8..0f4806583b 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -47611,7 +47611,7 @@ "type": "number" }, "ignore_dynamic_beyond_limit": { - "description": "A flag to ignore fields beyond the limit set for the maximum number of fields in an index.\nIf set to true, fields exceeding the limit will be ignored instead of causing an error.\nThis can be useful in scenarios where the data is dynamic and, it's acceptable to overlook extra fields.\nHowever, use this setting with caution as ignoring additional fields might lead to loss of data or unexpected search results.", + "description": "This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set\nto false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail\nwith the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail.\nInstead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false.\nThe fields that were not added to the mapping will be added to the _ignored field.", "type": "boolean" } } diff --git a/output/schema/schema.json b/output/schema/schema.json index ee2a8c91c7..1e5755ae2c 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -120913,7 +120913,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L547-L549" + "specLocation": "indices/_types/IndexSettings.ts#L548-L550" }, { "kind": "interface", @@ -120935,7 +120935,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L551-L558" + "specLocation": "indices/_types/IndexSettings.ts#L552-L559" }, { "kind": "interface", @@ -120989,7 +120989,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L560-L565" + "specLocation": "indices/_types/IndexSettings.ts#L561-L566" }, { "kind": "interface", @@ -121013,7 +121013,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L567-L574" + "specLocation": "indices/_types/IndexSettings.ts#L568-L575" }, { "kind": "enum", @@ -121159,7 +121159,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L442-L449" + "specLocation": "indices/_types/IndexSettings.ts#L443-L450" }, { "kind": "interface", @@ -121181,7 +121181,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L479-L485" + "specLocation": "indices/_types/IndexSettings.ts#L480-L486" }, { "kind": "interface", @@ -121203,7 +121203,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L470-L477" + "specLocation": "indices/_types/IndexSettings.ts#L471-L478" }, { "kind": "interface", @@ -121226,7 +121226,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L451-L459" + "specLocation": "indices/_types/IndexSettings.ts#L452-L460" }, { "kind": "interface", @@ -121249,7 +121249,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L461-L468" + "specLocation": "indices/_types/IndexSettings.ts#L462-L469" }, { "kind": "interface", @@ -121272,7 +121272,7 @@ } }, { - "description": "A flag to ignore fields beyond the limit set for the maximum number of fields in an index.\nIf set to true, fields exceeding the limit will be ignored instead of causing an error.\nThis can be useful in scenarios where the data is dynamic and, it's acceptable to overlook extra fields.\nHowever, use this setting with caution as ignoring additional fields might lead to loss of data or unexpected search results.", + "description": "This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set\nto false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail\nwith the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail.\nInstead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false.\nThe fields that were not added to the mapping will be added to the _ignored field.", "name": "ignore_dynamic_beyond_limit", "required": false, "serverDefault": false, @@ -121285,7 +121285,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L424-L440" + "specLocation": "indices/_types/IndexSettings.ts#L424-L441" }, { "kind": "interface", @@ -122059,7 +122059,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L487-L492" + "specLocation": "indices/_types/IndexSettings.ts#L488-L493" }, { "kind": "interface", @@ -122113,7 +122113,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L499-L504" + "specLocation": "indices/_types/IndexSettings.ts#L500-L505" }, { "kind": "interface", @@ -122145,7 +122145,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L494-L497" + "specLocation": "indices/_types/IndexSettings.ts#L495-L498" }, { "kind": "interface", @@ -122213,7 +122213,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L506-L515" + "specLocation": "indices/_types/IndexSettings.ts#L507-L516" }, { "isOpen": true, @@ -122240,7 +122240,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L517-L545" + "specLocation": "indices/_types/IndexSettings.ts#L518-L546" }, { "kind": "interface", diff --git a/specification/indices/_types/IndexSettings.ts b/specification/indices/_types/IndexSettings.ts index 7a7d76b6ee..bfd8890afa 100644 --- a/specification/indices/_types/IndexSettings.ts +++ b/specification/indices/_types/IndexSettings.ts @@ -430,10 +430,11 @@ export class MappingLimitSettingsTotalFields { */ limit?: long /** - * A flag to ignore fields beyond the limit set for the maximum number of fields in an index. - * If set to true, fields exceeding the limit will be ignored instead of causing an error. - * This can be useful in scenarios where the data is dynamic and, it's acceptable to overlook extra fields. - * However, use this setting with caution as ignoring additional fields might lead to loss of data or unexpected search results. + * This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set + * to false (the default), the index request of the document that tries to add a dynamic field to the mapping will fail + * with the message Limit of total fields [X] has been exceeded. When set to true, the index request will not fail. + * Instead, fields that would exceed the limit are not added to the mapping, similar to dynamic: false. + * The fields that were not added to the mapping will be added to the _ignored field. * @server_default false */ ignore_dynamic_beyond_limit?: boolean