Skip to content
1 change: 1 addition & 0 deletions specification/_global/delete/DeleteResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class Response {
* the response is the same as the successful case, but with a 404.
*/
statusCodes: [404]
// eslint-disable-next-line es-spec-validator/no-inline-unions, es-spec-validator/prefer-tagged-variants -- TODO: use tagged variant
body: WriteResponseBase | ErrorResponseBase
}
]
Expand Down
1 change: 1 addition & 0 deletions specification/_global/get/GetResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class Response<TDocument> {
// * index_not_found_exception as an error if the index doesn't exist
// * GetResult with only the requested _id, _index properties and found as a false boolean
statusCodes: [404]
// eslint-disable-next-line es-spec-validator/no-inline-unions, es-spec-validator/prefer-tagged-variants -- TODO: use tagged variant
body: GetResult<TDocument> | ErrorResponseBase
}
]
Expand Down
1 change: 1 addition & 0 deletions specification/_global/scripts_painless_execute/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@ export class PainlessScript {
* * `long`: `emit(long)`
* * `keyword`: `emit(String)`
*/
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
emit: boolean | DateTime | double | string | Ip | long
}
2 changes: 2 additions & 0 deletions specification/_global/search/SearchRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ export interface Request extends RequestBase {
* @availability serverless
* @ext_doc_id knn-approximate
*/

knn?: KnnSearch | KnnSearch[]
/**
* The Reciprocal Rank Fusion (RRF) to use.
Expand Down Expand Up @@ -494,6 +495,7 @@ export interface Request extends RequestBase {
/**
* Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases.
*/

rescore?: Rescore | Rescore[]
/**
* A retriever is a specification to describe top documents returned from a search.
Expand Down
1 change: 1 addition & 0 deletions specification/_global/search/_types/FieldCollapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class FieldCollapse {
/**
* The number of inner hits and their sort order
*/

inner_hits?: InnerHits | InnerHits[]
/**
* The number of concurrent requests allowed to retrieve the inner_hits per group
Expand Down
2 changes: 2 additions & 0 deletions specification/_global/search/_types/SearchRequestBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class SearchRequestBody {
* @availability serverless
* @ext_doc_id knn-approximate
*/

knn?: KnnSearch | KnnSearch[]
/**
* The Reciprocal Rank Fusion (RRF) to use.
Expand Down Expand Up @@ -129,6 +130,7 @@ export class SearchRequestBody {
/**
* Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases.
*/

rescore?: Rescore | Rescore[]
/**
* A retriever is a specification to describe top documents returned from a search.
Expand Down
2 changes: 2 additions & 0 deletions specification/_global/search/_types/hits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class Hit<TDocument> {
fields?: Dictionary<string, UserDefinedValue>
highlight?: Dictionary<string, string[]>
inner_hits?: Dictionary<string, InnerHitsResult>
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
matched_queries?: string[] | Dictionary<string, double>
_nested?: NestedIdentity
_ignored?: string[]
Expand All @@ -69,6 +70,7 @@ export class Hit<TDocument> {

export class HitsMetadata<T> {
/** Total hit count information, present only if `track_total_hits` wasn't `false` in the search request. */
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
total?: TotalHits | long
hits: Hit<T>[]

Expand Down
1 change: 1 addition & 0 deletions specification/_global/search/_types/suggester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export class RegexOptions {
* Optional operators for the regular expression.
* @doc_id regexp-syntax
*/
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
flags?: integer | string
/**
* Maximum number of automaton states required for the query.
Expand Down
2 changes: 2 additions & 0 deletions specification/_types/Knn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface KnnSearch {
/** Boost value to apply to kNN scores */
boost?: float
/** Filters for the kNN search query */

filter?: QueryContainer | QueryContainer[]
/** The minimum similarity for a vector to be considered a match */
similarity?: float
Expand Down Expand Up @@ -86,6 +87,7 @@ export interface KnnQuery extends QueryBase {
/** The final number of nearest neighbors to return as top hits */
k?: integer
/** Filters for the kNN search query */

filter?: QueryContainer | QueryContainer[]
/** The minimum similarity for a vector to be considered a match */
similarity?: float
Expand Down
2 changes: 2 additions & 0 deletions specification/_types/Retriever.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class RetrieverContainer {

export class RetrieverBase {
/** Query to filter the documents that can match. */

filter?: QueryContainer | QueryContainer[]
/** Minimum _score for matching documents. Documents with a lower _score are not included in the top documents. */
min_score?: float
Expand All @@ -63,6 +64,7 @@ export class RetrieverBase {
export class RescorerRetriever extends RetrieverBase {
/** Inner retriever. */
retriever: RetrieverContainer

rescore: Rescore | Rescore[]
}

Expand Down
1 change: 1 addition & 0 deletions specification/_types/aggregations/metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ export class TopMetricsAggregation extends MetricAggregationBase {
/**
* The fields of the top document to return.
*/

metrics?: TopMetricsValue | TopMetricsValue[]
/**
* The number of top documents from which to return metrics.
Expand Down
1 change: 1 addition & 0 deletions specification/_types/analysis/phonetic-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export enum PhoneticRuleType {
export class PhoneticTokenFilter extends TokenFilterBase {
type: 'phonetic'
encoder: PhoneticEncoder

languageset?: PhoneticLanguage | PhoneticLanguage[]
max_code_len?: integer
name_type?: PhoneticNameType
Expand Down
1 change: 1 addition & 0 deletions specification/_types/mapping/specialized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class SuggestContext {
name: Name
path?: Field
type: string
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
precision?: integer | string
}

Expand Down
5 changes: 5 additions & 0 deletions specification/_types/query_dsl/compound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class BoolQuery extends QueryBase {
* The clause (query) must appear in matching documents.
* However, unlike `must`, the score of the query will be ignored.
*/

filter?: QueryContainer | QueryContainer[]
/**
* Specifies the number or percentage of `should` clauses returned documents must match.
Expand All @@ -43,15 +44,18 @@ export class BoolQuery extends QueryBase {
/**
* The clause (query) must appear in matching documents and will contribute to the score.
*/

must?: QueryContainer | QueryContainer[]
/**
* The clause (query) must not appear in the matching documents.
* Because scoring is ignored, a score of `0` is returned for all documents.
*/

must_not?: QueryContainer | QueryContainer[]
/**
* The clause (query) should appear in the matching document.
*/

should?: QueryContainer | QueryContainer[]
}

Expand Down Expand Up @@ -143,6 +147,7 @@ export class ScriptScoreFunction {

export class RandomScoreFunction {
field?: Field
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
seed?: long | string
}

Expand Down
1 change: 1 addition & 0 deletions specification/_types/query_dsl/fulltext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ export class MatchQuery extends QueryBase {
*/
// FIXME: docs states "date" as a possible format. Add DateMath, or DurationLarge?
// Should also be consistent with MultiMatchQuery.query
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
query: string | float | boolean
/**
* Indicates whether no documents are returned if the `analyzer` removes all tokens, such as when using a `stop` filter.
Expand Down
2 changes: 2 additions & 0 deletions specification/_types/query_dsl/specialized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class MoreLikeThisQuery extends QueryBase {
/**
* Specifies free form text and/or a single or multiple documents for which you want to find similar documents.
*/

like: Like | Like[]
/**
* The maximum document frequency above which the terms are ignored from the input document.
Expand Down Expand Up @@ -165,6 +166,7 @@ export class MoreLikeThisQuery extends QueryBase {
/**
* Used in combination with `like` to exclude documents that match a set of terms.
*/

unlike?: Like | Like[]
version?: VersionNumber
/** @server_default 'internal' */
Expand Down
1 change: 1 addition & 0 deletions specification/_types/query_dsl/term.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class FuzzyQuery extends QueryBase {
// ES is lenient and accepts any primitive type, but ultimately converts it to a string.
// Changing this field definition from UserDefinedValue to string breaks a recording produced from Nest tests,
// but Nest is probably also overly flexible here and exposes an option that should not exist.
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
value: string | double | boolean
}

Expand Down
2 changes: 2 additions & 0 deletions specification/async_search/submit/AsyncSearchSubmitRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export interface Request extends RequestBase {
* @availability stack since=8.4.0
* @availability serverless
*/

knn?: KnnSearch | KnnSearch[]
/**
* Minimum _score for matching documents. Documents with a lower _score are
Expand All @@ -240,6 +241,7 @@ export interface Request extends RequestBase {
* Defines the search definition using the Query DSL.
*/
query?: QueryContainer

rescore?: Rescore | Rescore[]
/**
* Retrieve a script evaluation (based on different fields) for each hit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export interface Request extends RequestBase {
/**
* A comma-separated list of job types to fetch the sync jobs for
*/

job_type?: SyncJobType | SyncJobType[]
}
}
2 changes: 2 additions & 0 deletions specification/eql/search/EqlSearchRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export interface Request extends RequestBase {
/**
* Query, written in Query DSL, used to filter the events on which the EQL query runs.
*/

filter?: QueryContainer | QueryContainer[]
keep_alive?: Duration
keep_on_completion?: boolean
Expand All @@ -157,6 +158,7 @@ export interface Request extends RequestBase {
/**
* Array of wildcard (*) patterns. The response returns values for field names matching these patterns in the fields property of each hit.
*/

fields?: FieldAndFormat | FieldAndFormat[]
/**
* @server_default tail
Expand Down
4 changes: 3 additions & 1 deletion specification/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export default defineConfig({
'es-spec-validator/dictionary-key-is-string': 'error',
'es-spec-validator/no-native-types': 'error',
'es-spec-validator/invalid-node-types': 'error',
'es-spec-validator/no-generic-number': 'error'
'es-spec-validator/no-generic-number': 'error',
'es-spec-validator/no-inline-unions': 'error',
'es-spec-validator/prefer-tagged-variants': 'error'
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface Request extends RequestBase {
/**
* A single index or index alias that resolves to a single index.
*/
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
index: IndexName | IndexAlias
}
query_parameters: {
Expand Down
1 change: 1 addition & 0 deletions specification/fleet/msearch/MultiSearchRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface Request extends RequestBase {
/**
* A single target to search. If the target is an index alias, it must resolve to a single index.
*/
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
index?: IndexName | IndexAlias
}
query_parameters: {
Expand Down
2 changes: 2 additions & 0 deletions specification/fleet/search/SearchRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export interface Request extends RequestBase {
/**
* A single target to search. If the target is an index alias, it must resolve to a single index.
*/
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
index: IndexName | IndexAlias
}
query_parameters: {
Expand Down Expand Up @@ -184,6 +185,7 @@ export interface Request extends RequestBase {
* Defines the search definition using the Query DSL.
*/
query?: QueryContainer

rescore?: Rescore | Rescore[]
/**
* Retrieve a script evaluation (based on different fields) for each hit.
Expand Down
1 change: 1 addition & 0 deletions specification/indices/_types/IndexRouting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@ export class IndexRoutingAllocationInitialRecovery {

// ES: DiskThresholdSettings
export class IndexRoutingAllocationDisk {
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
threshold_enabled?: boolean | string
}
3 changes: 3 additions & 0 deletions specification/indices/_types/IndexSegmentSort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ import { Fields } from '@_types/common'

export class IndexSegmentSort {
field?: Fields

order?: SegmentSortOrder | SegmentSortOrder[]

mode?: SegmentSortMode | SegmentSortMode[]

missing?: SegmentSortMissing | SegmentSortMissing[]
}

Expand Down
10 changes: 10 additions & 0 deletions specification/indices/_types/IndexSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ export class IndexSettings
* @server_default 1
* @availability stack
* */
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
number_of_shards?: integer | string // TODO: should be only int
Comment on lines +87 to 88
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record, this a known issue with index settings that they can be passed as strings too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually be Stringyfied I think.

/**
* @server_default 0
* @availability stack
* */
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
number_of_replicas?: integer | string // TODO: should be only int
number_of_routing_shards?: integer
/** @server_default false */
Expand All @@ -100,6 +102,7 @@ export class IndexSettings
/** @server_default true */
load_fixed_bitset_filters_eagerly?: boolean
/** @server_default false */
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
hidden?: boolean | string // TODO should be bool only
/** @server_default false */
auto_expand_replicas?: WithNullValue<string>
Expand Down Expand Up @@ -147,11 +150,14 @@ export class IndexSettings
creation_date_string?: DateTime
uuid?: Uuid
version?: IndexVersioning
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
verified_before_close?: boolean | string
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
format?: string | integer
max_slices_per_scroll?: integer
translog?: Translog
query_string?: SettingsQueryString
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
priority?: integer | string
top_metrics_max_size?: integer
analysis?: IndexSettingsAnalysis
Expand Down Expand Up @@ -332,6 +338,7 @@ export class IndexSettingsLifecycle {
* applicable for an index).
* @server_default true
*/
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
prefer_ilm?: boolean | string
}

Expand Down Expand Up @@ -448,6 +455,7 @@ export class MappingLimitSettings {
field_name_length?: MappingLimitSettingsFieldNameLength
dimension_fields?: MappingLimitSettingsDimensionFields
source?: MappingLimitSettingsSourceFields
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
ignore_malformed?: boolean | string
}

Expand All @@ -458,6 +466,7 @@ export class MappingLimitSettingsTotalFields {
* degradations and memory issues, especially in clusters with a high load or few resources.
* @server_default 1000
*/
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
limit?: long | string
/**
* This setting determines what happens when a dynamically mapped field would exceed the total fields limit. When set
Expand All @@ -467,6 +476,7 @@ export class MappingLimitSettingsTotalFields {
* The fields that were not added to the mapping will be added to the _ignored field.
* @server_default false
*/
// eslint-disable-next-line es-spec-validator/no-inline-unions -- TODO: create named alias
ignore_dynamic_beyond_limit?: boolean | string
}

Expand Down
1 change: 1 addition & 0 deletions specification/indices/get_alias/IndicesGetAliasResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class Response {
exceptions: [
{
statusCodes: [404]
// eslint-disable-next-line es-spec-validator/no-inline-unions, es-spec-validator/prefer-tagged-variants -- TODO: use tagged variant
body: NotFoundAliases | ErrorResponseBase
}
]
Expand Down
1 change: 1 addition & 0 deletions specification/indices/resolve_index/ResolveIndexRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface Request extends RequestBase {
* @availability stack since=9.2.0 stability=stable
* @availability serverless stability=stable visibility=public
*/

mode?: IndexMode | IndexMode[]
/**
* Specifies a subset of projects to target using project
Expand Down
Loading