Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,899 changes: 898 additions & 1,001 deletions output/schema/schema.json

Large diffs are not rendered by default.

211 changes: 100 additions & 111 deletions output/typescript/types.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion specification/_global/reindex/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Sort } from '@global/search/_types/sort'
import { Sort } from '@_types/sort'
import {
Fields,
IndexName,
Expand Down
2 changes: 1 addition & 1 deletion specification/_global/search/SearchRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ import { FieldCollapse } from './_types/FieldCollapse'
import { Highlight } from './_types/highlighting'
import { PointInTimeReference } from './_types/PointInTimeReference'
import { Rescore } from './_types/rescoring'
import { Sort, SortResults } from './_types/sort'
import { SourceConfigParam, SourceConfig } from './_types/SourceFilter'
import { Suggester } from './_types/suggester'
import { TrackHits } from '@global/search/_types/hits'
import { Operator } from '@_types/query_dsl/Operator'
import { Sort, SortResults } from '@_types/sort'

/**
* @rest_spec_name search
Expand Down
2 changes: 1 addition & 1 deletion specification/_global/search/_types/hits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import { double, integer, long } from '@_types/Numeric'
import { ScriptField } from '@_types/Scripting'
import { FieldCollapse } from './FieldCollapse'
import { Highlight } from './highlighting'
import { Sort, SortResults } from './sort'
import { SourceConfig } from './SourceFilter'
import { FieldAndFormat } from '@_types/query_dsl/abstractions'
import { Sort, SortResults } from '@_types/sort'

export class Hit<TDocument> {
_index: IndexName
Expand Down
2 changes: 1 addition & 1 deletion specification/_global/search_mvt/SearchMvtRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Field, Fields, Indices } from '@_types/common'
import { AggregationContainer } from '@_types/aggregations/AggregationContainer'
import { GridType } from './_types/GridType'
import { Coordinate } from './_types/Coordinate'
import { Sort } from '@global/search/_types/sort'
import { Sort } from '@_types/sort'
import { QueryContainer } from '@_types/query_dsl/abstractions'
import { RuntimeFields } from '@_types/mapping/RuntimeFields'
import { integer } from '@_types/Numeric'
Expand Down
1 change: 0 additions & 1 deletion specification/_types/Result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

export enum Result {
Error = 0,
created = 1,
updated = 2,
deleted = 3,
Expand Down
2 changes: 1 addition & 1 deletion specification/_types/aggregations/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { SortOrder } from '@global/search/_types/sort'
import { SortOrder } from '@_types/sort'
import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
import { Field, RelationName, Fields } from '@_types/common'
Expand Down
11 changes: 2 additions & 9 deletions specification/_types/aggregations/matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,13 @@ import { Dictionary } from '@spec_utils/Dictionary'
import { Fields, Field } from '@_types/common'
import { double } from '@_types/Numeric'
import { Aggregation } from './Aggregation'
import { SortMode } from '@_types/sort'

export class MatrixAggregation extends Aggregation {
fields?: Fields
missing?: Dictionary<Field, double>
}

export class MatrixStatsAggregation extends MatrixAggregation {
mode?: MatrixStatsMode
}

export enum MatrixStatsMode {
avg = 0,
min = 1,
max = 2,
sum = 3,
median = 4
mode?: SortMode
}
2 changes: 1 addition & 1 deletion specification/_types/aggregations/metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { Highlight } from '@global/search/_types/highlighting'
import { SortOrder, Sort } from '@global/search/_types/sort'
import { SortOrder, Sort } from '@_types/sort'
import { SourceConfig } from '@global/search/_types/SourceFilter'
import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
Expand Down
2 changes: 1 addition & 1 deletion specification/_types/aggregations/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Sort } from '@global/search/_types/sort'
import { Sort } from '@_types/sort'
import { Dictionary } from '@spec_utils/Dictionary'
import { Name, Field, EmptyObject } from '@_types/common'
import { integer, double, float } from '@_types/Numeric'
Expand Down
29 changes: 29 additions & 0 deletions specification/_types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,32 @@ export class InlineGet<TDocument>
_routing?: Routing
_source: TDocument
}

/**
* Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded
* to actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices.
*/
export class IndicesOptions {
/**
* If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only
* missing or closed indices. This behavior applies even if the request targets other open indices. For example,
* a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.
*/
allow_no_indices?: boolean
/**
* Type of index that wildcard patterns can match. If the request can target data streams, this argument
* determines whether wildcard expressions match hidden data streams. Supports comma-separated values,
* such as `open,hidden`.
*/
expand_wildcards?: ExpandWildcards
/**
* If true, missing or closed indices are not included in the response.
* @server_default false
*/
ignore_unavailable?: boolean
/**
* If true, concrete, expanded or aliased indices are ignored when frozen.
* @server_default true
*/
ignore_throttled?: boolean
}
18 changes: 9 additions & 9 deletions specification/_types/query_dsl/joining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@ import { Field, Id, RelationName } from '@_types/common'
import { integer } from '@_types/Numeric'
import { QueryBase, QueryContainer } from './abstractions'

/**
* How to aggregate multiple child hit scores into a single parent score.
*/
export enum ChildScoreMode {
/* Do no scoring. */
none = 0,
/* Parent hit's score is the average of all child scores. */
avg = 1,
/* Parent hit's score is the max of all child scores. */
sum = 2,
/* Parent hit's score is the sum of all child scores. */
max = 3,
/* Parent hit's score is the min of all child scores. */
min = 4
}

Expand Down Expand Up @@ -59,15 +67,7 @@ export class NestedQuery extends QueryBase {
path: Field
query: QueryContainer
/** @server_default 'avg' */
score_mode?: NestedScoreMode
}

export enum NestedScoreMode {
avg = 0,
sum = 1,
min = 2,
max = 3,
none = 4
score_mode?: ChildScoreMode
}

export class ParentIdQuery extends QueryBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ export type Sort = SortCombinations | SortCombinations[]

export type SortResults = Array<long | double | string | null>

/**
* Defines what values to pick in the case a document contains multiple values for a particular field.
*/
export enum SortMode {
min = 0,
max = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { FieldCollapse } from '@global/search/_types/FieldCollapse'
import { Highlight } from '@global/search/_types/highlighting'
import { PointInTimeReference } from '@global/search/_types/PointInTimeReference'
import { Rescore } from '@global/search/_types/rescoring'
import { Sort, SortResults } from '@global/search/_types/sort'
import { Sort, SortResults } from '@_types/sort'
import {
SourceConfigParam,
SourceConfig
Expand Down
2 changes: 1 addition & 1 deletion specification/ingest/_types/Processors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { SortOrder } from '@global/search/_types/sort'
import { SortOrder } from '@_types/sort'
import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
import { Field, Fields, Id, Name } from '@_types/common'
Expand Down
32 changes: 4 additions & 28 deletions specification/ml/_types/Datafeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { Dictionary } from '@spec_utils/Dictionary'
import { AggregationContainer } from '@_types/aggregations/AggregationContainer'
import { ExpandWildcards, Id, Indices } from '@_types/common'
import { ExpandWildcards, Id, Indices, IndicesOptions } from '@_types/common'
import { RuntimeFields } from '@_types/mapping/RuntimeFields'
import { double, integer, long } from '@_types/Numeric'
import { QueryContainer } from '@_types/query_dsl/abstractions'
Expand All @@ -43,7 +43,7 @@ export class Datafeed {
scroll_size?: integer
delayed_data_check_config: DelayedDataCheckConfig
runtime_mappings?: RuntimeFields
indices_options?: DatafeedIndicesOptions
indices_options?: IndicesOptions
}

export class DatafeedConfig {
Expand Down Expand Up @@ -76,7 +76,7 @@ export class DatafeedConfig {
/**
* Specifies index expansion options that are used during search.
*/
indices_options?: DatafeedIndicesOptions
indices_options?: IndicesOptions
job_id?: Id
/**
* If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped.
Expand Down Expand Up @@ -118,6 +118,7 @@ export class DelayedDataCheckConfig {
enabled: boolean
}

// Identical to WatcherState, but kept separate as they're different enums in ES
export enum DatafeedState {
started = 0,
stopped = 1,
Expand Down Expand Up @@ -161,28 +162,3 @@ export class ChunkingConfig {
* @server_default 3h */
time_span?: Time
}

export class DatafeedIndicesOptions {
/**
* If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only
* missing or closed indices. This behavior applies even if the request targets other open indices. For example,
* a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.
*/
allow_no_indices?: boolean
/**
* Type of index that wildcard patterns can match. If the request can target data streams, this argument
* determines whether wildcard expressions match hidden data streams. Supports comma-separated values,
* such as `open,hidden`.
*/
expand_wildcards?: ExpandWildcards
/**
* If true, missing or closed indices are not included in the response.
* @server_default false
*/
ignore_unavailable?: boolean
/**
* If true, concrete, expanded or aliased indices are ignored when frozen.
* @server_default true
*/
ignore_throttled?: boolean
}
10 changes: 3 additions & 7 deletions specification/ml/put_datafeed/MlPutDatafeedRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@
* under the License.
*/

import {
ChunkingConfig,
DatafeedIndicesOptions,
DelayedDataCheckConfig
} from '@ml/_types/Datafeed'
import { ChunkingConfig, DelayedDataCheckConfig } from '@ml/_types/Datafeed'
import { Dictionary } from '@spec_utils/Dictionary'
import { AggregationContainer } from '@_types/aggregations/AggregationContainer'
import { RequestBase } from '@_types/Base'
import { ExpandWildcards, Id, Indices } from '@_types/common'
import { ExpandWildcards, Id, Indices, IndicesOptions } from '@_types/common'
import { RuntimeFields } from '@_types/mapping/RuntimeFields'
import { integer } from '@_types/Numeric'
import { QueryContainer } from '@_types/query_dsl/abstractions'
Expand Down Expand Up @@ -120,7 +116,7 @@ export interface Request extends RequestBase {
/**
* Specifies index expansion options that are used during search
*/
indices_options?: DatafeedIndicesOptions
indices_options?: IndicesOptions
/**
* Identifier for the anomaly detection job.
*/
Expand Down
10 changes: 3 additions & 7 deletions specification/ml/put_datafeed/MlPutDatafeedResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@
* under the License.
*/

import {
ChunkingConfig,
DatafeedIndicesOptions,
DelayedDataCheckConfig
} from '@ml/_types/Datafeed'
import { ChunkingConfig, DelayedDataCheckConfig } from '@ml/_types/Datafeed'
import { Dictionary } from '@spec_utils/Dictionary'
import { AggregationContainer } from '@_types/aggregations/AggregationContainer'
import { Id, Indices } from '@_types/common'
import { Id, Indices, IndicesOptions } from '@_types/common'
import { RuntimeFields } from '@_types/mapping/RuntimeFields'
import { integer } from '@_types/Numeric'
import { QueryContainer } from '@_types/query_dsl/abstractions'
Expand All @@ -40,7 +36,7 @@ export class Response {
frequency: Time
indices: string[]
job_id: Id
indices_options?: DatafeedIndicesOptions
indices_options?: IndicesOptions
max_empty_searches: integer
query: QueryContainer
query_delay: Time
Expand Down
10 changes: 3 additions & 7 deletions specification/ml/update_datafeed/MlUpdateDatafeedRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@
*/

import { RequestBase } from '@_types/Base'
import { ExpandWildcards, Id } from '@_types/common'
import { ExpandWildcards, Id, IndicesOptions } from '@_types/common'
import { Dictionary } from '@spec_utils/Dictionary'
import { AggregationContainer } from '@_types/aggregations/AggregationContainer'
import {
ChunkingConfig,
DatafeedIndicesOptions,
DelayedDataCheckConfig
} from '@ml/_types/Datafeed'
import { ChunkingConfig, DelayedDataCheckConfig } from '@ml/_types/Datafeed'
import { Time } from '@_types/Time'
import { integer } from '@_types/Numeric'
import { QueryContainer } from '@_types/query_dsl/abstractions'
Expand Down Expand Up @@ -120,7 +116,7 @@ export interface Request extends RequestBase {
/**
* Specifies index expansion options that are used during search.
*/
indices_options?: DatafeedIndicesOptions
indices_options?: IndicesOptions
/**
* If a real-time datafeed has never seen any data (including during any initial training period), it automatically
* stops and closes the associated job after this many real-time searches return no documents. In other words,
Expand Down
10 changes: 3 additions & 7 deletions specification/ml/update_datafeed/MlUpdateDatafeedResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@
* under the License.
*/

import {
ChunkingConfig,
DatafeedIndicesOptions,
DelayedDataCheckConfig
} from '@ml/_types/Datafeed'
import { ChunkingConfig, DelayedDataCheckConfig } from '@ml/_types/Datafeed'
import { Dictionary } from '@spec_utils/Dictionary'
import { AggregationContainer } from '@_types/aggregations/AggregationContainer'
import { Id, Indices } from '@_types/common'
import { Id, IndicesOptions } from '@_types/common'
import { RuntimeFields } from '@_types/mapping/RuntimeFields'
import { integer } from '@_types/Numeric'
import { QueryContainer } from '@_types/query_dsl/abstractions'
Expand All @@ -40,7 +36,7 @@ export class Response {
frequency: Time
indices: string[]
job_id: Id
indices_options?: DatafeedIndicesOptions
indices_options?: IndicesOptions
max_empty_searches: integer
query: QueryContainer
query_delay: Time
Expand Down
2 changes: 1 addition & 1 deletion specification/sql/translate/TranslateSqlResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Sort } from '@global/search/_types/sort'
import { Sort } from '@_types/sort'
import { SourceConfig } from '@global/search/_types/SourceFilter'
import { Dictionary } from '@spec_utils/Dictionary'
import { Field, Fields } from '@_types/common'
Expand Down
8 changes: 1 addition & 7 deletions specification/watcher/_types/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
import {
ExpandWildcards,
IndexName,
IndicesOptions,
Password,
SearchType,
Username
Expand Down Expand Up @@ -86,13 +87,6 @@ export class HttpInputRequestDefinition {
url?: string
}

export class IndicesOptions {
allow_no_indices?: boolean
expand_wildcards?: ExpandWildcards
ignore_unavailable?: boolean
ignore_throttled?: boolean
}

export class Input {}

/**
Expand Down
Loading