From 026ff1ea99208c9ae676b5914bee35cef527140a Mon Sep 17 00:00:00 2001 From: Michael Peterson Date: Fri, 1 Sep 2023 08:56:37 -0400 Subject: [PATCH] Search Response has completion_time and _cluster/details (#2260) Updates the spec for the response objects for `POST _async_search`, `GET _async_search/:id`, `GET _async_search/status/:id` and `GET _search` Two high level changes have happened in 8.10: 1) `completion_time` and `completion_time_in_millis` (async_search only) https://github.com/elastic/elasticsearch/pull/97700 2) Adding `details` metadata to the `_clusters` section of both async and synchronous search responses https://github.com/elastic/elasticsearch/pull/97731 --- output/schema/schema.json | 344 ++++++++++++++---- output/typescript/types.ts | 17 + specification/_types/Stats.ts | 20 +- specification/_types/common.ts | 2 + .../_types/AsyncSearchResponseBase.ts | 6 + .../status/AsyncSearchStatusResponse.ts | 7 +- 6 files changed, 319 insertions(+), 77 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 23726b4e49..2c6d0cfe17 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -39415,7 +39415,7 @@ "name": "AggregateName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L126-L130", + "specLocation": "_types/common.ts#L128-L132", "type": { "kind": "instance_of", "type": { @@ -39614,7 +39614,7 @@ } } ], - "specLocation": "_types/Stats.ts#L47-L57" + "specLocation": "_types/Stats.ts#L65-L75" }, { "docId": "byte-units", @@ -39624,7 +39624,7 @@ "name": "ByteSize", "namespace": "_types" }, - "specLocation": "_types/common.ts#L88-L89", + "specLocation": "_types/common.ts#L90-L91", "type": { "items": [ { @@ -39677,7 +39677,7 @@ "name": "Bytes", "namespace": "_types" }, - "specLocation": "_types/common.ts#L150-L168" + "specLocation": "_types/common.ts#L152-L170" }, { "kind": "type_alias", @@ -39694,6 +39694,109 @@ } } }, + { + "kind": "type_alias", + "name": { + "name": "ClusterAlias", + "namespace": "_types" + }, + "specLocation": "_types/common.ts#L72-L72", + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "kind": "interface", + "name": { + "name": "ClusterDetails", + "namespace": "_types" + }, + "properties": [ + { + "name": "status", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ClusterSearchStatus", + "namespace": "_types" + } + } + }, + { + "name": "indices", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "took", + "required": false, + "type": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "kind": "instance_of", + "type": { + "name": "DurationValue", + "namespace": "_types" + } + } + }, + { + "name": "timed_out", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "_shards", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ShardStatistics", + "namespace": "_types" + } + } + }, + { + "name": "failures", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ShardFailure", + "namespace": "_types" + } + } + } + } + ], + "specLocation": "_types/Stats.ts#L42-L49" + }, { "kind": "enum", "members": [ @@ -39717,7 +39820,7 @@ "name": "ClusterInfoTarget", "namespace": "_types" }, - "specLocation": "_types/common.ts#L344-L350" + "specLocation": "_types/common.ts#L346-L352" }, { "kind": "type_alias", @@ -39725,7 +39828,7 @@ "name": "ClusterInfoTargets", "namespace": "_types" }, - "specLocation": "_types/common.ts#L352-L352", + "specLocation": "_types/common.ts#L354-L354", "type": { "items": [ { @@ -39749,6 +39852,31 @@ "kind": "union_of" } }, + { + "kind": "enum", + "members": [ + { + "name": "running" + }, + { + "name": "successful" + }, + { + "name": "partial" + }, + { + "name": "skipped" + }, + { + "name": "failed" + } + ], + "name": { + "name": "ClusterSearchStatus", + "namespace": "_types" + }, + "specLocation": "_types/Stats.ts#L34-L40" + }, { "kind": "interface", "name": { @@ -39788,9 +39916,31 @@ "namespace": "_types" } } + }, + { + "name": "details", + "required": false, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "ClusterAlias", + "namespace": "_types" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "ClusterDetails", + "namespace": "_types" + } + } + } } ], - "specLocation": "_types/Stats.ts#L27-L31" + "specLocation": "_types/Stats.ts#L27-L32" }, { "kind": "interface", @@ -39846,7 +39996,7 @@ } } ], - "specLocation": "_types/Stats.ts#L59-L69" + "specLocation": "_types/Stats.ts#L77-L87" }, { "kind": "enum", @@ -39862,7 +40012,7 @@ "name": "Conflicts", "namespace": "_types" }, - "specLocation": "_types/common.ts#L170-L173" + "specLocation": "_types/common.ts#L172-L175" }, { "kind": "interface", @@ -39995,7 +40145,7 @@ "name": "DataStreamName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L83-L84", + "specLocation": "_types/common.ts#L85-L86", "type": { "kind": "instance_of", "type": { @@ -40010,7 +40160,7 @@ "name": "DataStreamNames", "namespace": "_types" }, - "specLocation": "_types/common.ts#L86-L86", + "specLocation": "_types/common.ts#L88-L88", "type": { "items": [ { @@ -40196,7 +40346,7 @@ } } ], - "specLocation": "_types/Stats.ts#L76-L88" + "specLocation": "_types/Stats.ts#L94-L106" }, { "description": "A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and\n`d` (days). Also accepts \"0\" without a unit and \"-1\" to indicate an unspecified value.", @@ -40383,7 +40533,7 @@ "namespace": "_types" }, "properties": [], - "specLocation": "_types/common.ts#L141-L142" + "specLocation": "_types/common.ts#L143-L144" }, { "generics": [ @@ -40576,7 +40726,7 @@ "name": "ExpandWildcard", "namespace": "_types" }, - "specLocation": "_types/common.ts#L182-L196" + "specLocation": "_types/common.ts#L184-L198" }, { "kind": "type_alias", @@ -40584,7 +40734,7 @@ "name": "ExpandWildcards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L198-L198", + "specLocation": "_types/common.ts#L200-L200", "type": { "items": [ { @@ -40615,7 +40765,7 @@ "name": "Field", "namespace": "_types" }, - "specLocation": "_types/common.ts#L119-L120", + "specLocation": "_types/common.ts#L121-L122", "type": { "kind": "instance_of", "type": { @@ -40654,7 +40804,7 @@ } } ], - "specLocation": "_types/Stats.ts#L97-L100" + "specLocation": "_types/Stats.ts#L115-L118" }, { "kind": "interface", @@ -40686,7 +40836,7 @@ } } ], - "specLocation": "_types/Stats.ts#L71-L74" + "specLocation": "_types/Stats.ts#L89-L92" }, { "kind": "interface", @@ -40921,7 +41071,7 @@ } } ], - "specLocation": "_types/Stats.ts#L90-L95" + "specLocation": "_types/Stats.ts#L108-L113" }, { "kind": "type_alias", @@ -40929,7 +41079,7 @@ "name": "Fields", "namespace": "_types" }, - "specLocation": "_types/common.ts#L121-L121", + "specLocation": "_types/common.ts#L123-L123", "type": { "items": [ { @@ -41014,7 +41164,7 @@ } } ], - "specLocation": "_types/Stats.ts#L102-L107" + "specLocation": "_types/Stats.ts#L120-L125" }, { "docId": "fuzziness", @@ -41024,7 +41174,7 @@ "name": "Fuzziness", "namespace": "_types" }, - "specLocation": "_types/common.ts#L114-L115", + "specLocation": "_types/common.ts#L116-L117", "type": { "items": [ { @@ -41608,7 +41758,7 @@ } } ], - "specLocation": "_types/Stats.ts#L109-L120" + "specLocation": "_types/Stats.ts#L127-L138" }, { "kind": "enum", @@ -41639,7 +41789,7 @@ "name": "HealthStatus", "namespace": "_types" }, - "specLocation": "_types/common.ts#L200-L220" + "specLocation": "_types/common.ts#L202-L222" }, { "kind": "type_alias", @@ -41662,7 +41812,7 @@ "name": "HttpHeaders", "namespace": "_types" }, - "specLocation": "_types/common.ts#L139-L139", + "specLocation": "_types/common.ts#L141-L141", "type": { "key": { "kind": "instance_of", @@ -42048,7 +42198,7 @@ } } ], - "specLocation": "_types/Stats.ts#L122-L138" + "specLocation": "_types/Stats.ts#L140-L156" }, { "kind": "type_alias", @@ -42139,7 +42289,7 @@ } } ], - "specLocation": "_types/common.ts#L298-L325" + "specLocation": "_types/common.ts#L300-L327" }, { "inherits": { @@ -42278,7 +42428,7 @@ } } ], - "specLocation": "_types/common.ts#L287-L296" + "specLocation": "_types/common.ts#L289-L298" }, { "inherits": { @@ -42519,7 +42669,7 @@ "name": "Level", "namespace": "_types" }, - "specLocation": "_types/common.ts#L230-L234" + "specLocation": "_types/common.ts#L232-L236" }, { "kind": "enum", @@ -42766,7 +42916,7 @@ } } ], - "specLocation": "_types/Stats.ts#L140-L157" + "specLocation": "_types/Stats.ts#L158-L175" }, { "kind": "type_alias", @@ -42774,7 +42924,7 @@ "name": "Metadata", "namespace": "_types" }, - "specLocation": "_types/common.ts#L91-L91", + "specLocation": "_types/common.ts#L93-L93", "type": { "key": { "kind": "instance_of", @@ -42829,7 +42979,7 @@ "name": "MinimumShouldMatch", "namespace": "_types" }, - "specLocation": "_types/common.ts#L144-L148", + "specLocation": "_types/common.ts#L146-L150", "type": { "items": [ { @@ -42858,7 +43008,7 @@ "name": "MultiTermQueryRewrite", "namespace": "_types" }, - "specLocation": "_types/common.ts#L116-L117", + "specLocation": "_types/common.ts#L118-L119", "type": { "kind": "instance_of", "type": { @@ -42873,7 +43023,7 @@ "name": "Name", "namespace": "_types" }, - "specLocation": "_types/common.ts#L72-L72", + "specLocation": "_types/common.ts#L74-L74", "type": { "kind": "instance_of", "type": { @@ -42888,7 +43038,7 @@ "name": "Names", "namespace": "_types" }, - "specLocation": "_types/common.ts#L73-L73", + "specLocation": "_types/common.ts#L75-L75", "type": { "items": [ { @@ -42918,7 +43068,7 @@ "name": "Namespace", "namespace": "_types" }, - "specLocation": "_types/common.ts#L75-L75", + "specLocation": "_types/common.ts#L77-L77", "type": { "kind": "instance_of", "type": { @@ -43144,7 +43294,7 @@ "name": "NodeName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L80-L81", + "specLocation": "_types/common.ts#L82-L83", "type": { "kind": "instance_of", "type": { @@ -43478,7 +43628,7 @@ "name": "OpType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L236-L239" + "specLocation": "_types/common.ts#L238-L241" }, { "kind": "type_alias", @@ -43486,7 +43636,7 @@ "name": "Password", "namespace": "_types" }, - "specLocation": "_types/common.ts#L176-L176", + "specLocation": "_types/common.ts#L178-L178", "type": { "kind": "instance_of", "type": { @@ -43528,7 +43678,7 @@ "name": "PipelineName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L78-L78", + "specLocation": "_types/common.ts#L80-L80", "type": { "kind": "instance_of", "type": { @@ -43647,7 +43797,7 @@ } } ], - "specLocation": "_types/Stats.ts#L159-L169" + "specLocation": "_types/Stats.ts#L177-L187" }, { "kind": "type_alias", @@ -43655,7 +43805,7 @@ "name": "PropertyName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L111-L111", + "specLocation": "_types/common.ts#L113-L113", "type": { "kind": "instance_of", "type": { @@ -43768,7 +43918,7 @@ } } ], - "specLocation": "_types/Stats.ts#L171-L205" + "specLocation": "_types/Stats.ts#L189-L223" }, { "kind": "type_alias", @@ -43907,7 +44057,7 @@ } } ], - "specLocation": "_types/Stats.ts#L207-L212" + "specLocation": "_types/Stats.ts#L225-L230" }, { "esQuirk": "This is a boolean that evolved into an enum. ES also accepts plain booleans for true and false.", @@ -43927,7 +44077,7 @@ "name": "Refresh", "namespace": "_types" }, - "specLocation": "_types/common.ts#L241-L248" + "specLocation": "_types/common.ts#L243-L250" }, { "kind": "interface", @@ -44021,7 +44171,7 @@ } } ], - "specLocation": "_types/Stats.ts#L214-L221" + "specLocation": "_types/Stats.ts#L232-L239" }, { "kind": "type_alias", @@ -44029,7 +44179,7 @@ "name": "RelationName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L112-L112", + "specLocation": "_types/common.ts#L114-L114", "type": { "kind": "instance_of", "type": { @@ -44142,7 +44292,7 @@ } } ], - "specLocation": "_types/Stats.ts#L223-L229" + "specLocation": "_types/Stats.ts#L241-L247" }, { "kind": "enum", @@ -44841,7 +44991,7 @@ } } ], - "specLocation": "_types/Stats.ts#L231-L250" + "specLocation": "_types/Stats.ts#L249-L268" }, { "kind": "interface", @@ -44891,7 +45041,7 @@ "name": "SearchType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L250-L255" + "specLocation": "_types/common.ts#L252-L257" }, { "kind": "interface", @@ -45198,7 +45348,7 @@ } } ], - "specLocation": "_types/Stats.ts#L252-L345" + "specLocation": "_types/Stats.ts#L270-L363" }, { "kind": "type_alias", @@ -45206,7 +45356,7 @@ "name": "SequenceNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L109-L109", + "specLocation": "_types/common.ts#L111-L111", "type": { "kind": "instance_of", "type": { @@ -45221,7 +45371,7 @@ "name": "Service", "namespace": "_types" }, - "specLocation": "_types/common.ts#L76-L76", + "specLocation": "_types/common.ts#L78-L78", "type": { "kind": "instance_of", "type": { @@ -45363,7 +45513,7 @@ } } ], - "specLocation": "_types/Stats.ts#L33-L45" + "specLocation": "_types/Stats.ts#L51-L63" }, { "kind": "interface", @@ -45440,7 +45590,7 @@ "name": "Slices", "namespace": "_types" }, - "specLocation": "_types/common.ts#L327-L332", + "specLocation": "_types/common.ts#L329-L334", "type": { "items": [ { @@ -45473,7 +45623,7 @@ "name": "SlicesCalculation", "namespace": "_types" }, - "specLocation": "_types/common.ts#L334-L342" + "specLocation": "_types/common.ts#L336-L344" }, { "kind": "type_alias", @@ -45763,7 +45913,7 @@ } } ], - "specLocation": "_types/Stats.ts#L347-L374" + "specLocation": "_types/Stats.ts#L365-L392" }, { "kind": "interface", @@ -45866,7 +46016,7 @@ "name": "SuggestMode", "namespace": "_types" }, - "specLocation": "_types/common.ts#L257-L261" + "specLocation": "_types/common.ts#L259-L263" }, { "description": "The suggestion name as returned from the server. Depending whether typed_keys is specified this could come back\nin the form of `name#type` instead of simply `name`", @@ -45875,7 +46025,7 @@ "name": "SuggestionName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L132-L136", + "specLocation": "_types/common.ts#L134-L138", "type": { "kind": "instance_of", "type": { @@ -45944,7 +46094,7 @@ "name": "TaskId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L113-L113", + "specLocation": "_types/common.ts#L115-L115", "type": { "items": [ { @@ -46020,7 +46170,7 @@ "name": "ThreadType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L263-L269" + "specLocation": "_types/common.ts#L265-L271" }, { "description": "Time of day, expressed as HH:MM:SS", @@ -46289,7 +46439,7 @@ } } ], - "specLocation": "_types/Stats.ts#L376-L384" + "specLocation": "_types/Stats.ts#L394-L402" }, { "kind": "type_alias", @@ -46376,7 +46526,7 @@ "name": "Username", "namespace": "_types" }, - "specLocation": "_types/common.ts#L175-L175", + "specLocation": "_types/common.ts#L177-L177", "type": { "kind": "instance_of", "type": { @@ -46391,7 +46541,7 @@ "name": "Uuid", "namespace": "_types" }, - "specLocation": "_types/common.ts#L106-L106", + "specLocation": "_types/common.ts#L108-L108", "type": { "kind": "instance_of", "type": { @@ -46406,7 +46556,7 @@ "name": "VersionNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L94-L94", + "specLocation": "_types/common.ts#L96-L96", "type": { "kind": "instance_of", "type": { @@ -46421,7 +46571,7 @@ "name": "VersionString", "namespace": "_types" }, - "specLocation": "_types/common.ts#L96-L96", + "specLocation": "_types/common.ts#L98-L98", "type": { "kind": "instance_of", "type": { @@ -46450,7 +46600,7 @@ "name": "VersionType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L98-L103" + "specLocation": "_types/common.ts#L100-L105" }, { "kind": "enum", @@ -46466,7 +46616,7 @@ "name": "WaitForActiveShardOptions", "namespace": "_types" }, - "specLocation": "_types/common.ts#L271-L275" + "specLocation": "_types/common.ts#L273-L277" }, { "codegenNames": [ @@ -46478,7 +46628,7 @@ "name": "WaitForActiveShards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L123-L124", + "specLocation": "_types/common.ts#L125-L126", "type": { "items": [ { @@ -46525,7 +46675,7 @@ "name": "WaitForEvents", "namespace": "_types" }, - "specLocation": "_types/common.ts#L277-L284" + "specLocation": "_types/common.ts#L279-L286" }, { "kind": "interface", @@ -46588,7 +46738,7 @@ } } ], - "specLocation": "_types/Stats.ts#L386-L391" + "specLocation": "_types/Stats.ts#L404-L409" }, { "kind": "interface", @@ -79011,7 +79161,7 @@ } } ], - "specLocation": "async_search/_types/AsyncSearchResponseBase.ts#L44-L48" + "specLocation": "async_search/_types/AsyncSearchResponseBase.ts#L50-L54" }, { "kind": "interface", @@ -79117,9 +79267,41 @@ "namespace": "_types" } } + }, + { + "description": "Indicates when the async search completed. Only present\nwhen the search has completed.", + "name": "completion_time", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DateTime", + "namespace": "_types" + } + } + }, + { + "name": "completion_time_in_millis", + "required": false, + "type": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "kind": "instance_of", + "type": { + "name": "EpochTime", + "namespace": "_types" + } + } } ], - "specLocation": "async_search/_types/AsyncSearchResponseBase.ts#L24-L43" + "specLocation": "async_search/_types/AsyncSearchResponseBase.ts#L24-L49" }, { "attachedBehaviors": [ @@ -79333,7 +79515,7 @@ "name": "Response", "namespace": "async_search.status" }, - "specLocation": "async_search/status/AsyncSearchStatusResponse.ts#L34-L36" + "specLocation": "async_search/status/AsyncSearchStatusResponse.ts#L39-L41" }, { "inherits": { @@ -79360,6 +79542,18 @@ } } }, + { + "description": "Metadata about clusters involved in the cross-cluster search.\nNot shown for local-only searches.", + "name": "_clusters", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ClusterStatistics", + "namespace": "_types" + } + } + }, { "description": "If the async search completed, this field shows the status code of the search.\nFor example, 200 indicates that the async search was successfully completed.\n503 indicates that the async search was completed with an error.", "name": "completion_status", @@ -79373,7 +79567,7 @@ } } ], - "specLocation": "async_search/status/AsyncSearchStatusResponse.ts#L24-L33" + "specLocation": "async_search/status/AsyncSearchStatusResponse.ts#L24-L38" }, { "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index de276226e0..f5369efa92 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2055,14 +2055,28 @@ export type Bytes = 'b' | 'kb' | 'mb' | 'gb' | 'tb' | 'pb' export type CategoryId = string +export type ClusterAlias = string + +export interface ClusterDetails { + status: ClusterSearchStatus + indices: string + took?: DurationValue + timed_out: boolean + _shards?: ShardStatistics + failures?: ShardFailure[] +} + export type ClusterInfoTarget = '_all' | 'http' | 'ingest' | 'thread_pool' | 'script' export type ClusterInfoTargets = ClusterInfoTarget | ClusterInfoTarget[] +export type ClusterSearchStatus = 'running' | 'successful' | 'partial' | 'skipped' | 'failed' + export interface ClusterStatistics { skipped: integer successful: integer total: integer + details?: Record } export interface CompletionStats { @@ -6105,6 +6119,8 @@ export interface AsyncSearchAsyncSearchResponseBase { expiration_time_in_millis: EpochTime start_time?: DateTime start_time_in_millis: EpochTime + completion_time?: DateTime + completion_time_in_millis?: EpochTime } export interface AsyncSearchDeleteRequest extends RequestBase { @@ -6130,6 +6146,7 @@ export type AsyncSearchStatusResponse = AsyncSearchStatusStatusResponseBase export interface AsyncSearchStatusStatusResponseBase extends AsyncSearchAsyncSearchResponseBase { _shards: ShardStatistics + _clusters?: ClusterStatistics completion_status?: integer } diff --git a/specification/_types/Stats.ts b/specification/_types/Stats.ts index 8292b61595..c6bad2c0cd 100644 --- a/specification/_types/Stats.ts +++ b/specification/_types/Stats.ts @@ -19,7 +19,7 @@ import { ShardFileSizeInfo } from '@indices/stats/types' import { Dictionary } from '@spec_utils/Dictionary' -import { ByteSize, Field, Name, VersionString } from './common' +import { ByteSize, ClusterAlias, Field, Name, VersionString } from './common' import { ShardFailure } from './Errors' import { double, integer, long, uint } from './Numeric' import { Duration, DurationValue, UnitMillis } from '@_types/Time' @@ -28,6 +28,24 @@ export class ClusterStatistics { skipped: integer successful: integer total: integer + details?: Dictionary +} + +enum ClusterSearchStatus { + running = 0, + successful = 1, + partial = 2, + skipped = 3, + failed = 4 +} + +export class ClusterDetails { + status: ClusterSearchStatus + indices: string + took?: DurationValue + timed_out: boolean + _shards?: ShardStatistics + failures?: ShardFailure[] } export class ShardStatistics { diff --git a/specification/_types/common.ts b/specification/_types/common.ts index 3bccb37f4e..3b306bca9c 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -69,6 +69,8 @@ export type LongId = string export type IndexMetrics = string export type Metrics = string | string[] +export type ClusterAlias = string + export type Name = string export type Names = Name | Name[] diff --git a/specification/async_search/_types/AsyncSearchResponseBase.ts b/specification/async_search/_types/AsyncSearchResponseBase.ts index d61fa179dc..b909c943c7 100644 --- a/specification/async_search/_types/AsyncSearchResponseBase.ts +++ b/specification/async_search/_types/AsyncSearchResponseBase.ts @@ -40,6 +40,12 @@ export class AsyncSearchResponseBase { expiration_time_in_millis: EpochTime start_time?: DateTime start_time_in_millis: EpochTime + /** + * Indicates when the async search completed. Only present + * when the search has completed. + */ + completion_time?: DateTime + completion_time_in_millis?: EpochTime } export class AsyncSearchDocumentResponseBase< TDocument diff --git a/specification/async_search/status/AsyncSearchStatusResponse.ts b/specification/async_search/status/AsyncSearchStatusResponse.ts index 221c912096..278b406e33 100644 --- a/specification/async_search/status/AsyncSearchStatusResponse.ts +++ b/specification/async_search/status/AsyncSearchStatusResponse.ts @@ -19,11 +19,16 @@ import { AsyncSearchResponseBase } from '@async_search/_types/AsyncSearchResponseBase' import { integer } from '@_types/Numeric' -import { ShardStatistics } from '@_types/Stats' +import { ClusterStatistics, ShardStatistics } from '@_types/Stats' export class StatusResponseBase extends AsyncSearchResponseBase { /** Indicates how many shards have run the query so far. */ _shards: ShardStatistics + /** + * Metadata about clusters involved in the cross-cluster search. + * Not shown for local-only searches. + */ + _clusters?: ClusterStatistics /** * If the async search completed, this field shows the status code of the search. * For example, 200 indicates that the async search was successfully completed.