From 0da3245c665a802e04863c1c87ef2019d3d3656b Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Tue, 23 Nov 2021 18:15:55 +0100 Subject: [PATCH] Fix some index setting fields (#1056) --- output/schema/schema.json | 52 +++++++++++++++---- output/typescript/types.ts | 6 +-- specification/indices/_types/IndexRouting.ts | 3 +- .../indices/_types/IndexSegmentSort.ts | 4 +- 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 452741fa47..be273e8873 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -90074,7 +90074,7 @@ "properties": [ { "name": "threshold_enabled", - "required": true, + "required": false, "type": { "items": [ { @@ -90258,22 +90258,52 @@ "name": "mode", "required": false, "type": { - "kind": "instance_of", - "type": { - "name": "SegmentSortMode", - "namespace": "indices._types" - } + "items": [ + { + "kind": "instance_of", + "type": { + "name": "SegmentSortMode", + "namespace": "indices._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "SegmentSortMode", + "namespace": "indices._types" + } + } + } + ], + "kind": "union_of" } }, { "name": "missing", "required": false, "type": { - "kind": "instance_of", - "type": { - "name": "SegmentSortMissing", - "namespace": "indices._types" - } + "items": [ + { + "kind": "instance_of", + "type": { + "name": "SegmentSortMissing", + "namespace": "indices._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "SegmentSortMissing", + "namespace": "indices._types" + } + } + } + ], + "kind": "union_of" } } ] diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 9a04fe44e2..0659a110d5 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -8877,7 +8877,7 @@ export interface IndicesIndexRoutingAllocation { } export interface IndicesIndexRoutingAllocationDisk { - threshold_enabled: boolean | string + threshold_enabled?: boolean | string } export interface IndicesIndexRoutingAllocationInclude { @@ -8900,8 +8900,8 @@ export type IndicesIndexRoutingRebalanceOptions = 'all' | 'primaries' | 'replica export interface IndicesIndexSegmentSort { field: Fields order: IndicesSegmentSortOrder | IndicesSegmentSortOrder[] - mode?: IndicesSegmentSortMode - missing?: IndicesSegmentSortMissing + mode?: IndicesSegmentSortMode | IndicesSegmentSortMode[] + missing?: IndicesSegmentSortMissing | IndicesSegmentSortMissing[] } export interface IndicesIndexSettingBlocks { diff --git a/specification/indices/_types/IndexRouting.ts b/specification/indices/_types/IndexRouting.ts index 3c68a512c2..16f5e9235a 100644 --- a/specification/indices/_types/IndexRouting.ts +++ b/specification/indices/_types/IndexRouting.ts @@ -58,6 +58,7 @@ export class IndexRoutingAllocationInitialRecovery { _id?: Id } +// ES: DiskThresholdSettings export class IndexRoutingAllocationDisk { - threshold_enabled: boolean | string + threshold_enabled?: boolean | string } diff --git a/specification/indices/_types/IndexSegmentSort.ts b/specification/indices/_types/IndexSegmentSort.ts index c8b55ace68..6b96328f11 100644 --- a/specification/indices/_types/IndexSegmentSort.ts +++ b/specification/indices/_types/IndexSegmentSort.ts @@ -22,8 +22,8 @@ import { Fields } from '@_types/common' export class IndexSegmentSort { field: Fields order: SegmentSortOrder | SegmentSortOrder[] - mode?: SegmentSortMode - missing?: SegmentSortMissing + mode?: SegmentSortMode | SegmentSortMode[] + missing?: SegmentSortMissing | SegmentSortMissing[] } export enum SegmentSortOrder {