diff --git a/api/OpenSearchApi.d.ts b/api/OpenSearchApi.d.ts index b735dafc8..d2aaea179 100644 --- a/api/OpenSearchApi.d.ts +++ b/api/OpenSearchApi.d.ts @@ -1454,6 +1454,10 @@ export default class OpenSearchAPI { bulk (params: API.Bulk_Request, callback: callbackFn): TransportRequestCallback; bulk (params: API.Bulk_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + bulkStream (params: API.BulkStream_Request, options?: TransportRequestOptions): TransportRequestPromise; + bulkStream (params: API.BulkStream_Request, callback: callbackFn): TransportRequestCallback; + bulkStream (params: API.BulkStream_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + count (params?: API.Count_Request, options?: TransportRequestOptions): TransportRequestPromise; count (callback: callbackFn): TransportRequestCallback; count (params: API.Count_Request, callback: callbackFn): TransportRequestCallback; diff --git a/api/OpenSearchApi.js b/api/OpenSearchApi.js index 272ddbbbf..506520aa6 100644 --- a/api/OpenSearchApi.js +++ b/api/OpenSearchApi.js @@ -52,6 +52,7 @@ class OpenSearchAPI { // Setup Root API Functions /** @namespace API-Core */ this.bulk = require('./_core/bulk').bind(this) + this.bulkStream = require('./_core/bulkStream').bind(this) this.clearScroll = require('./_core/clearScroll').bind(this) this.count = require('./_core/count').bind(this) this.create = require('./_core/create').bind(this) @@ -94,6 +95,8 @@ class OpenSearchAPI { this.updateByQuery = require('./_core/updateByQuery').bind(this) this.updateByQueryRethrottle = require('./_core/updateByQueryRethrottle').bind(this) + // Deprecated: Use bulkStream instead. + this.bulk_stream = require('./_core/bulkStream').bind(this) // Deprecated: Use clearScroll instead. this.clear_scroll = require('./_core/clearScroll').bind(this) // Deprecated: Use createPit instead. diff --git a/api/_core/bulkStream.d.ts b/api/_core/bulkStream.d.ts new file mode 100644 index 000000000..5edb381b6 --- /dev/null +++ b/api/_core/bulkStream.d.ts @@ -0,0 +1,52 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' +import * as Core_Bulk from '../_types/_core.bulk' +import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' + +export interface BulkStream_Request extends Global.Params { + _source?: Core_Search.SourceConfigParam; + _source_excludes?: Common.Fields; + _source_includes?: Common.Fields; + batch_interval?: Common.Duration; + batch_size?: Common.BatchSize; + body: BulkStream_RequestBody; + index?: Common.IndexName; + pipeline?: string; + refresh?: Common.Refresh; + require_alias?: boolean; + routing?: Common.Routing; + timeout?: Common.Duration; + type?: string; + wait_for_active_shards?: Common.WaitForActiveShards; +} + +export type BulkStream_RequestBody = Core_Bulk.OperationContainer | Core_Bulk.UpdateAction | Record[] + +export interface BulkStream_Response extends ApiResponse { + body: BulkStream_ResponseBody; +} + +export interface BulkStream_ResponseBody { + errors: boolean; + ingest_took?: number; + items: Record[]; + took: number; +} + diff --git a/api/_core/bulkStream.js b/api/_core/bulkStream.js new file mode 100644 index 000000000..f9a00e346 --- /dev/null +++ b/api/_core/bulkStream.js @@ -0,0 +1,61 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Allows to perform multiple index/update/delete operations using request response streaming. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/bulk-streaming/ - bulk_stream} + * + * @memberOf API-Core + * + * @param {object} params + * @param {string} [params._source] - `true` or `false` to return the `_source` field or not, or a list of fields to return. + * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude from the response. + * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the response. + * @param {string} [params.batch_interval] - Specifies for how long bulk operations should be accumulated into a batch before sending the batch to data nodes. + * @param {number} [params.batch_size] - Specifies how many bulk operations should be accumulated into a batch before sending the batch to data nodes. + * @param {string} [params.pipeline] - ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. + * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. + * @param {boolean} [params.require_alias=false] - If `true`, the request's actions must target an index alias. + * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.timeout] - Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. + * @param {string} [params.type] - Default document type for items which don't provide one. + * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * @param {string} [params.index] - Name of the data stream, index, or index alias to perform bulk actions on. + * @param {array} params.body - The operation definition and data (action-data pairs), separated by newlines + * + * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ +function bulkStreamFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = ['/', index, '/_bulk/stream'].filter(c => c).join('').replace('//', '/'); + const method = index == null ? 'POST' : 'PUT'; + + return this.transport.request({ method, path, querystring, bulkBody: body }, options, callback); +} + +module.exports = bulkStreamFunc; diff --git a/api/_types/_common.aggregations.d.ts b/api/_types/_common.aggregations.d.ts index 2242f3366..9c17ec2f4 100644 --- a/api/_types/_common.aggregations.d.ts +++ b/api/_types/_common.aggregations.d.ts @@ -994,7 +994,9 @@ export interface MutualInformationHeuristic { include_negatives?: boolean; } -export type NestedAggregate = SingleBucketAggregateBase & Record +export interface NestedAggregate extends SingleBucketAggregateBase { + doc_count?: number; +} export interface NestedAggregation extends BucketAggregationBase { path?: Common.Field; diff --git a/api/_types/_common.analysis.d.ts b/api/_types/_common.analysis.d.ts index 3151a7b55..e7ec2f06c 100644 --- a/api/_types/_common.analysis.d.ts +++ b/api/_types/_common.analysis.d.ts @@ -16,7 +16,7 @@ import * as Common from './_common' -export type Analyzer = CustomAnalyzer | FingerprintAnalyzer | KeywordAnalyzer | LanguageAnalyzer | NoriAnalyzer | PatternAnalyzer | SimpleAnalyzer | StandardAnalyzer | StopAnalyzer | WhitespaceAnalyzer | IcuAnalyzer | KuromojiAnalyzer | SnowballAnalyzer | DutchAnalyzer +export type Analyzer = CustomAnalyzer | FingerprintAnalyzer | KeywordAnalyzer | LanguageAnalyzer | NoriAnalyzer | PatternAnalyzer | SimpleAnalyzer | StandardAnalyzer | StopAnalyzer | WhitespaceAnalyzer | IcuAnalyzer | KuromojiAnalyzer | SnowballAnalyzer | DutchAnalyzer | SmartcnAnalyzer | CjkAnalyzer export interface AsciiFoldingTokenFilter extends TokenFilterBase { preserve_original?: Common.Stringifiedboolean; @@ -37,6 +37,12 @@ export interface CharGroupTokenizer extends TokenizerBase { type: 'char_group'; } +export interface CjkAnalyzer { + stopwords?: StopWords; + stopwords_path?: string; + type?: 'cjk'; +} + export interface CommonGramsTokenFilter extends TokenFilterBase { common_words?: string[]; common_words_path?: string; @@ -160,7 +166,7 @@ export type IcuCollationAlternate = 'non-ignorable' | 'shifted' export type IcuCollationCaseFirst = 'lower' | 'upper' -export type IcuCollationDecomposition = 'identical' | 'no' +export type IcuCollationDecomposition = 'canonical' | 'no' export type IcuCollationStrength = 'identical' | 'primary' | 'quaternary' | 'secondary' | 'tertiary' @@ -428,6 +434,10 @@ export interface PatternTokenizer extends TokenizerBase { type: 'pattern'; } +export interface PersianStemTokenFilter extends TokenFilterBase { + type: 'persian_stem'; +} + export type PhoneticEncoder = 'beider_morse' | 'caverphone1' | 'caverphone2' | 'cologne' | 'daitch_mokotoff' | 'double_metaphone' | 'haasephonetik' | 'koelnerphonetik' | 'metaphone' | 'nysiis' | 'refined_soundex' | 'soundex' export type PhoneticLanguage = 'any' | 'common' | 'cyrillic' | 'english' | 'french' | 'german' | 'hebrew' | 'hungarian' | 'polish' | 'romanian' | 'russian' | 'spanish' @@ -478,6 +488,18 @@ export interface SimpleAnalyzer { version?: Common.VersionString; } +export interface SmartcnAnalyzer { + type?: 'smartcn'; +} + +export interface SmartcnStopTokenFilter extends TokenFilterBase { + type: 'smartcn_stop'; +} + +export interface SmartcnTokenizer extends TokenizerBase { + type: 'smartcn_tokenizer'; +} + export interface SnowballAnalyzer { language: SnowballLanguage; stopwords?: StopWords; @@ -563,7 +585,7 @@ export interface TokenFilterBase { version?: Common.VersionString; } -export type TokenFilterDefinition = AsciiFoldingTokenFilter | CommonGramsTokenFilter | ConditionTokenFilter | DelimitedPayloadTokenFilter | EdgeNGramTokenFilter | ElisionTokenFilter | FingerprintTokenFilter | HunspellTokenFilter | HyphenationDecompounderTokenFilter | KeepTypesTokenFilter | KeepWordsTokenFilter | KeywordMarkerTokenFilter | KStemTokenFilter | LengthTokenFilter | LimitTokenCountTokenFilter | LowercaseTokenFilter | MultiplexerTokenFilter | NGramTokenFilter | NoriPartOfSpeechTokenFilter | PatternCaptureTokenFilter | PatternReplaceTokenFilter | PorterStemTokenFilter | PredicateTokenFilter | RemoveDuplicatesTokenFilter | ReverseTokenFilter | ShingleTokenFilter | SnowballTokenFilter | StemmerOverrideTokenFilter | StemmerTokenFilter | StopTokenFilter | SynonymGraphTokenFilter | SynonymTokenFilter | TrimTokenFilter | TruncateTokenFilter | UniqueTokenFilter | UppercaseTokenFilter | WordDelimiterGraphTokenFilter | WordDelimiterTokenFilter | KuromojiStemmerTokenFilter | KuromojiReadingFormTokenFilter | KuromojiPartOfSpeechTokenFilter | IcuTokenizer | IcuCollationTokenFilter | IcuFoldingTokenFilter | IcuNormalizationTokenFilter | IcuTransformTokenFilter | PhoneticTokenFilter | DictionaryDecompounderTokenFilter +export type TokenFilterDefinition = AsciiFoldingTokenFilter | CommonGramsTokenFilter | ConditionTokenFilter | DelimitedPayloadTokenFilter | EdgeNGramTokenFilter | ElisionTokenFilter | FingerprintTokenFilter | HunspellTokenFilter | HyphenationDecompounderTokenFilter | KeepTypesTokenFilter | KeepWordsTokenFilter | KeywordMarkerTokenFilter | KStemTokenFilter | LengthTokenFilter | LimitTokenCountTokenFilter | LowercaseTokenFilter | MultiplexerTokenFilter | NGramTokenFilter | NoriPartOfSpeechTokenFilter | PatternCaptureTokenFilter | PatternReplaceTokenFilter | PersianStemTokenFilter | PorterStemTokenFilter | PredicateTokenFilter | RemoveDuplicatesTokenFilter | ReverseTokenFilter | ShingleTokenFilter | SnowballTokenFilter | StemmerOverrideTokenFilter | StemmerTokenFilter | StopTokenFilter | SynonymGraphTokenFilter | SynonymTokenFilter | TrimTokenFilter | TruncateTokenFilter | UniqueTokenFilter | UppercaseTokenFilter | WordDelimiterGraphTokenFilter | WordDelimiterTokenFilter | KuromojiStemmerTokenFilter | KuromojiReadingFormTokenFilter | KuromojiPartOfSpeechTokenFilter | IcuTokenizer | IcuCollationTokenFilter | IcuFoldingTokenFilter | IcuNormalizationTokenFilter | IcuTransformTokenFilter | PhoneticTokenFilter | DictionaryDecompounderTokenFilter | SmartcnStopTokenFilter export type Tokenizer = string | TokenizerDefinition @@ -571,7 +593,7 @@ export interface TokenizerBase { version?: Common.VersionString; } -export type TokenizerDefinition = CharGroupTokenizer | EdgeNGramTokenizer | KeywordTokenizer | LetterTokenizer | LowercaseTokenizer | NGramTokenizer | NoriTokenizer | PathHierarchyTokenizer | StandardTokenizer | UaxEmailUrlTokenizer | WhitespaceTokenizer | KuromojiTokenizer | PatternTokenizer | IcuTokenizer +export type TokenizerDefinition = CharGroupTokenizer | EdgeNGramTokenizer | KeywordTokenizer | LetterTokenizer | LowercaseTokenizer | NGramTokenizer | NoriTokenizer | PathHierarchyTokenizer | StandardTokenizer | UaxEmailUrlTokenizer | WhitespaceTokenizer | KuromojiTokenizer | PatternTokenizer | IcuTokenizer | SmartcnTokenizer export interface TrimTokenFilter extends TokenFilterBase { type: 'trim'; diff --git a/api/_types/_common.d.ts b/api/_types/_common.d.ts index 829920c24..3d11253cf 100644 --- a/api/_types/_common.d.ts +++ b/api/_types/_common.d.ts @@ -33,6 +33,8 @@ export interface BaseNode { transport_address?: TransportAddress; } +export type BatchSize = number + export type BulkByScrollFailure = BulkItemResponseFailure | ScrollableHitSourceSearchFailure export interface BulkByScrollResponseBase extends BulkByScrollTaskStatus { @@ -431,8 +433,6 @@ export interface NodeStatistics { total: number; } -export type Normalization = 'h1' | 'h2' | 'h3' | 'no' | 'z' - export interface OpenSearchVersionInfo { build_date: DateTime; build_flavor?: string; @@ -604,6 +604,8 @@ export interface RequestStats { total?: number; } +export type ResourceType = 'index_or_alias' + export type Result = 'created' | 'deleted' | 'noop' | 'not_found' | 'updated' export interface Retries { @@ -817,6 +819,8 @@ export interface TaskFailure { export type TaskId = string | number +export type TermFrequencyNormalization = 'h1' | 'h2' | 'h3' | 'no' | 'z' + export type TimeOfDay = string export type TimeUnit = 'd' | 'h' | 'm' | 'micros' | 'ms' | 'nanos' | 's' diff --git a/api/_types/_common.mapping.d.ts b/api/_types/_common.mapping.d.ts index 539e759a6..6c7310c23 100644 --- a/api/_types/_common.mapping.d.ts +++ b/api/_types/_common.mapping.d.ts @@ -66,7 +66,7 @@ export interface CompletionProperty extends DocValuesPropertyBase { export interface ConstantKeywordProperty extends PropertyBase { type: 'constant_keyword'; - value?: Record; + value?: any; } export interface CorePropertyBase extends PropertyBase { @@ -135,32 +135,6 @@ export interface DoubleRangeProperty extends RangePropertyBase { export type DynamicMapping = 'false' | 'strict' | 'strict_allow_templates' | 'true' -export interface DynamicProperty extends DocValuesPropertyBase { - analyzer?: string; - boost?: number; - coerce?: boolean; - eager_global_ordinals?: boolean; - enabled?: boolean; - format?: string; - ignore_malformed?: boolean; - index?: boolean; - index_options?: IndexOptions; - index_phrases?: boolean; - index_prefixes?: TextIndexPrefixes; - locale?: string; - norms?: boolean; - null_value?: Common.FieldValue; - on_script_error?: OnScriptError; - position_increment_gap?: number; - precision_step?: number; - script?: Common.Script; - search_analyzer?: string; - search_quote_analyzer?: string; - term_vector?: TermVectorOption; - time_series_metric?: TimeSeriesMetricType; - type: '{dynamic_property}'; -} - export interface DynamicTemplate { mapping?: Property; match?: string; @@ -207,7 +181,7 @@ export interface FloatRangeProperty extends RangePropertyBase { type: 'float_range'; } -export type GeoOrientation = 'left' | 'right' +export type GeoOrientation = 'LEFT' | 'clockwise' | 'cw' | 'left' | 'RIGHT' | 'ccw' | 'counterclockwise' | 'right' export interface GeoPointProperty extends DocValuesPropertyBase { ignore_malformed?: boolean; @@ -290,21 +264,20 @@ export interface KeywordProperty extends DocValuesPropertyBase { export interface KnnVectorMethod { engine?: string; name: string; - parameters?: Record>; + parameters?: { +}; space_type?: string; } -export interface KnnVectorProperty extends KnnVectorPropertyBase { - type: 'knn_vector'; -} - -export interface KnnVectorPropertyBase { +export interface KnnVectorProperty extends DocValuesPropertyBase { compression_level?: string; data_type?: string; dimension: number; method?: KnnVectorMethod; mode?: string; + model_id?: string; space_type?: string; + type: 'knn_vector'; } export interface LongNumberProperty extends NumberPropertyBase { @@ -358,7 +331,7 @@ export interface PercolatorProperty extends PropertyBase { type: 'percolator'; } -export type Property = BinaryProperty | BooleanProperty | DynamicProperty | JoinProperty | KeywordProperty | MatchOnlyTextProperty | PercolatorProperty | RankFeatureProperty | RankFeaturesProperty | SearchAsYouTypeProperty | TextProperty | VersionProperty | WildcardProperty | DateNanosProperty | DateProperty | AggregateMetricDoubleProperty | DenseVectorProperty | SparseVectorProperty | FlattenedProperty | NestedProperty | ObjectProperty | CompletionProperty | ConstantKeywordProperty | FieldAliasProperty | HistogramProperty | IpProperty | Murmur3HashProperty | TokenCountProperty | GeoPointProperty | GeoShapeProperty | XyPointProperty | XyShapeProperty | ByteNumberProperty | DoubleNumberProperty | FloatNumberProperty | HalfFloatNumberProperty | IntegerNumberProperty | LongNumberProperty | ScaledFloatNumberProperty | ShortNumberProperty | UnsignedLongNumberProperty | DateRangeProperty | DoubleRangeProperty | FloatRangeProperty | IntegerRangeProperty | IpRangeProperty | LongRangeProperty | KnnVectorProperty +export type Property = BinaryProperty | BooleanProperty | JoinProperty | KeywordProperty | MatchOnlyTextProperty | PercolatorProperty | RankFeatureProperty | RankFeaturesProperty | SearchAsYouTypeProperty | TextProperty | VersionProperty | WildcardProperty | DateNanosProperty | DateProperty | AggregateMetricDoubleProperty | DenseVectorProperty | SparseVectorProperty | FlattenedProperty | NestedProperty | ObjectProperty | CompletionProperty | ConstantKeywordProperty | FieldAliasProperty | HistogramProperty | IpProperty | Murmur3HashProperty | TokenCountProperty | GeoPointProperty | GeoShapeProperty | XyPointProperty | XyShapeProperty | ByteNumberProperty | DoubleNumberProperty | FloatNumberProperty | HalfFloatNumberProperty | IntegerNumberProperty | LongNumberProperty | ScaledFloatNumberProperty | ShortNumberProperty | UnsignedLongNumberProperty | DateRangeProperty | DoubleRangeProperty | FloatRangeProperty | IntegerRangeProperty | IpRangeProperty | LongRangeProperty | KnnVectorProperty export interface PropertyBase { dynamic?: DynamicMapping; diff --git a/api/_types/_core.search.d.ts b/api/_types/_core.search.d.ts index 19257340f..27bf126e5 100644 --- a/api/_types/_core.search.d.ts +++ b/api/_types/_core.search.d.ts @@ -84,6 +84,8 @@ export interface AggregationProfileDelegateDebugFilter { export type BoundaryScanner = 'chars' | 'sentence' | 'word' +export type BuiltinHighlighterType = 'fvh' | 'plain' | 'unified' + export interface Collector { children?: Collector[]; name: string; @@ -136,7 +138,6 @@ export interface FetchProfileDebug { } export interface FieldCollapse { - collapse?: FieldCollapse; field: Common.Field; inner_hits?: InnerHits | InnerHits[]; max_concurrent_group_searches?: number; @@ -179,7 +180,7 @@ export type HighlighterOrder = 'score' export type HighlighterTagsSchema = 'styled' -export type HighlighterType = 'fvh' | 'plain' | 'unified' +export type HighlighterType = BuiltinHighlighterType | string export interface HighlightField extends HighlightBase { analyzer?: Common_Analysis.Analyzer; diff --git a/api/_types/cluster._common.d.ts b/api/_types/cluster._common.d.ts index d641d2aab..4f942e444 100644 --- a/api/_types/cluster._common.d.ts +++ b/api/_types/cluster._common.d.ts @@ -32,7 +32,6 @@ export interface ComponentTemplateNode { export interface ComponentTemplateSummary { _meta?: Common.Metadata; aliases?: Record; - lifecycle?: Indices_Common.DataStreamLifecycleWithRollover; mappings?: Common_Mapping.TypeMapping; settings?: Record; version?: Common.VersionNumber; diff --git a/api/_types/indices._common.d.ts b/api/_types/indices._common.d.ts index 23f5b3229..dc57f5606 100644 --- a/api/_types/indices._common.d.ts +++ b/api/_types/indices._common.d.ts @@ -37,10 +37,6 @@ export interface AliasDefinition { search_routing?: string; } -export interface CacheQueries { - enabled: boolean; -} - export interface DataStream { _meta?: Common.Metadata; allow_custom_routing?: boolean; @@ -48,7 +44,6 @@ export interface DataStream { hidden?: boolean; ilm_policy?: Common.Name; indices: DataStreamIndex[]; - lifecycle?: DataStreamLifecycleWithRollover; name: Common.DataStreamName; next_generation_managed_by?: ManagedBy; prefer_ilm?: boolean; @@ -67,47 +62,10 @@ export interface DataStreamIndex { prefer_ilm?: boolean; } -export interface DataStreamLifecycle { - data_retention?: Common.Duration; - downsampling?: DataStreamLifecycleDownsampling; -} - -export interface DataStreamLifecycleDownsampling { - rounds: DownsamplingRound[]; -} - -export interface DataStreamLifecycleRolloverConditions { - max_age?: string; - max_docs?: number; - max_primary_shard_docs?: number; - max_primary_shard_size?: Common.HumanReadableByteCount; - max_size?: Common.HumanReadableByteCount; - min_age?: Common.Duration; - min_docs?: number; - min_primary_shard_docs?: number; - min_primary_shard_size?: Common.HumanReadableByteCount; - min_size?: Common.HumanReadableByteCount; -} - -export interface DataStreamLifecycleWithRollover { - data_retention?: Common.Duration; - downsampling?: DataStreamLifecycleDownsampling; - rollover?: DataStreamLifecycleRolloverConditions; -} - export interface DataStreamTimestampField { name: Common.Field; } -export interface DownsampleConfig { - fixed_interval: Common.DurationLarge; -} - -export interface DownsamplingRound { - after: Common.Duration; - config: DownsampleConfig; -} - export interface FielddataFrequencyFilter { max: number; min: number; @@ -116,15 +74,26 @@ export interface FielddataFrequencyFilter { export type IndexCheckOnStartup = 'checksum' | 'false' | 'true' +export interface IndexErrorCause { + index?: Common.IndexName; + index_uuid?: Common.Uuid; + reason?: string; + 'resource.id'?: Common.IndexName; + 'resource.type'?: Common.ResourceType; + root_cause?: IndexErrorCause[]; + type: string; + [key: string]: any | Record; +} + export interface IndexingPressure { memory: IndexingPressureMemory; } export interface IndexingPressureMemory { - limit?: number; + limit?: string | number; } -export interface IndexingSlowlogSettings { +export interface IndexingSlowlog { level?: string; reformat?: boolean; source?: number; @@ -148,7 +117,7 @@ export interface IndexRoutingAllocation { } export interface IndexRoutingAllocationDisk { - threshold_enabled?: boolean | string; + threshold_enabled?: Common.Stringifiedboolean; } export interface IndexRoutingAllocationInclude { @@ -185,9 +154,15 @@ export interface IndexSettingBlocks { export interface IndexSettings { analysis?: IndexSettingsAnalysis; - analyze?: SettingsAnalyze; + analyze?: IndexSettingsAnalyze; + 'analyze.max_token_count'?: Common.Stringifiedinteger; auto_expand_replicas?: string; blocks?: IndexSettingBlocks; + 'blocks.metadata'?: Common.Stringifiedboolean; + 'blocks.read'?: Common.Stringifiedboolean; + 'blocks.read_only'?: Common.Stringifiedboolean; + 'blocks.read_only_allow_delete'?: Common.Stringifiedboolean; + 'blocks.write'?: Common.Stringifiedboolean; check_on_startup?: IndexCheckOnStartup; codec?: string; creation_date?: Common.StringifiedEpochTimeUnitMillis; @@ -196,14 +171,18 @@ export interface IndexSettings { final_pipeline?: Common.PipelineName; format?: string | number; gc_deletes?: Common.Duration; - hidden?: boolean | string; - highlight?: SettingsHighlight; + hidden?: Common.Stringifiedboolean; + highlight?: IndexSettingsHighlight; + 'highlight.max_analyzed_offset'?: number; index?: IndexSettings; + indexing?: IndexSettingsIndexing; indexing_pressure?: IndexingPressure; - 'indexing.slowlog'?: IndexingSlowlogSettings; + knn?: boolean; + 'knn.algo_param.ef_search'?: number; lifecycle?: IndexSettingsLifecycle; + 'lifecycle.name'?: Common.Name; load_fixed_bitset_filters_eagerly?: boolean; - mapping?: MappingLimitSettings; + mapping?: IndexSettingsMapping; max_docvalue_fields_search?: number; max_inner_result_window?: number; max_ngram_diff?: number; @@ -215,31 +194,38 @@ export interface IndexSettings { max_shingle_diff?: number; max_slices_per_scroll?: number; max_terms_count?: number; - merge?: Merge; + merge?: IndexSettingsMerge; + 'merge.scheduler.max_thread_count'?: Common.Stringifiedinteger; mode?: string; number_of_replicas?: number | string; number_of_routing_shards?: number; number_of_shards?: number | string; priority?: number | string; provided_name?: Common.Name; - queries?: Queries; - query_string?: SettingsQueryString; + queries?: IndexSettingsQueries; + query_string?: IndexSettingsQueryString; + 'query_string.lenient'?: Common.Stringifiedboolean; refresh_interval?: Common.Duration; routing?: IndexRouting; routing_partition_size?: Common.Stringifiedinteger; routing_path?: string | string[]; - search?: SettingsSearch; + search?: IndexSettingsSearch; + 'search.idle.after'?: Common.Duration; settings?: IndexSettings; - similarity?: SettingsSimilarity; + similarity?: IndexSettingsSimilarity; soft_deletes?: SoftDeletes; + 'soft_deletes.retention_lease.period'?: Common.Duration; sort?: IndexSegmentSort; - store?: Storage; + store?: IndexSettingsStore; time_series?: IndexSettingsTimeSeries; top_metrics_max_size?: number; translog?: Translog; + 'translog.durability'?: TranslogDurability; + 'translog.flush_threshold_size'?: Common.HumanReadableByteCount; uuid?: Common.Uuid; - verified_before_close?: boolean | string; + verified_before_close?: Common.Stringifiedboolean; version?: IndexVersioning; + [key: string]: any | Record; } export interface IndexSettingsAnalysis { @@ -250,10 +236,22 @@ export interface IndexSettingsAnalysis { tokenizer?: Record; } +export interface IndexSettingsAnalyze { + max_token_count?: Common.Stringifiedinteger; +} + +export interface IndexSettingsHighlight { + max_analyzed_offset?: number; +} + +export interface IndexSettingsIndexing { + slowlog?: IndexingSlowlog; +} + export interface IndexSettingsLifecycle { indexing_complete?: Common.Stringifiedboolean; name: Common.Name; - origination_date?: number; + origination_date?: Common.StringifiedEpochTimeUnitMillis; parse_origination_date?: boolean; rollover_alias?: string; step?: IndexSettingsLifecycleStep; @@ -263,194 +261,197 @@ export interface IndexSettingsLifecycleStep { wait_time_threshold?: Common.Duration; } -export interface IndexSettingsTimeSeries { - end_time?: Common.DateTime; - start_time?: Common.DateTime; -} - -export interface IndexState { - aliases?: Record; - data_stream?: Common.DataStreamName; - defaults?: IndexSettings; - lifecycle?: DataStreamLifecycle; - mappings?: Common_Mapping.TypeMapping; - settings?: IndexSettings; -} - -export interface IndexTemplate { - _meta?: Common.Metadata; - allow_auto_create?: boolean; - composed_of?: Common.Name[]; - data_stream?: IndexTemplateDataStreamConfiguration; - index_patterns: Common.Names; - priority?: number; - template?: IndexTemplateSummary; - version?: Common.VersionNumber; -} - -export interface IndexTemplateDataStreamConfiguration { - allow_custom_routing?: boolean; - hidden?: boolean; - timestamp_field?: DataStreamTimestampField; -} - -export interface IndexTemplateSummary { - aliases?: Record; - lifecycle?: DataStreamLifecycleWithRollover; - mappings?: Common_Mapping.TypeMapping; - settings?: IndexSettings; -} - -export interface IndexVersioning { - created?: Common.VersionString; - created_string?: string; -} - -export type ManagedBy = 'Data stream lifecycle' | 'Index Lifecycle Management' | 'Unmanaged' - -export interface MappingLimitSettings { +export interface IndexSettingsMapping { coerce?: boolean; - depth?: MappingLimitSettingsDepth; - dimension_fields?: MappingLimitSettingsDimensionFields; - field_name_length?: MappingLimitSettingsFieldNameLength; + depth?: IndexSettingsMappingLimitDepth; + dimension_fields?: IndexSettingsMappingLimitDimensionFields; + field_name_length?: IndexSettingsMappingLimitFieldNameLength; ignore_malformed?: boolean; - nested_fields?: MappingLimitSettingsNestedFields; - nested_objects?: MappingLimitSettingsNestedObjects; - total_fields?: MappingLimitSettingsTotalFields; + nested_fields?: IndexSettingsMappingLimitNestedFields; + nested_objects?: IndexSettingsMappingLimitNestedObjects; + total_fields?: IndexSettingsMappingLimitTotalFields; } -export interface MappingLimitSettingsDepth { +export interface IndexSettingsMappingLimitDepth { limit?: number; } -export interface MappingLimitSettingsDimensionFields { +export interface IndexSettingsMappingLimitDimensionFields { limit?: number; } -export interface MappingLimitSettingsFieldNameLength { +export interface IndexSettingsMappingLimitFieldNameLength { limit?: number; } -export interface MappingLimitSettingsNestedFields { +export interface IndexSettingsMappingLimitNestedFields { limit?: number; } -export interface MappingLimitSettingsNestedObjects { +export interface IndexSettingsMappingLimitNestedObjects { limit?: number; } -export interface MappingLimitSettingsTotalFields { +export interface IndexSettingsMappingLimitTotalFields { limit?: number; } -export interface Merge { - scheduler?: MergeScheduler; +export interface IndexSettingsMerge { + scheduler?: IndexSettingsMergeScheduler; } -export interface MergeScheduler { +export interface IndexSettingsMergeScheduler { max_merge_count?: Common.Stringifiedinteger; max_thread_count?: Common.Stringifiedinteger; } -export interface NumericFielddata { - format: NumericFielddataFormat; -} - -export type NumericFielddataFormat = 'array' | 'disabled' - -export interface Queries { - cache?: CacheQueries; -} - -export interface RetentionLease { - period: Common.Duration; -} - -export interface SearchIdle { - after?: Common.Duration; -} - -export type SegmentSortMissing = '_first' | '_last' - -export type SegmentSortMode = 'max' | 'min' - -export type SegmentSortOrder = 'asc' | 'desc' - -export interface SettingsAnalyze { - max_token_count?: Common.Stringifiedinteger; +export interface IndexSettingsQueries { + cache?: IndexSettingsQueriesCache; } -export interface SettingsHighlight { - max_analyzed_offset?: number; +export interface IndexSettingsQueriesCache { + enabled: boolean; } -export interface SettingsQueryString { - lenient: Common.Stringifiedboolean; +export interface IndexSettingsQueryString { + lenient?: Common.Stringifiedboolean; } -export interface SettingsSearch { +export interface IndexSettingsSearch { idle?: SearchIdle; - slowlog?: SlowlogSettings; + slowlog?: SearchSlowlog; } -export interface SettingsSimilarity { - bm25?: SettingsSimilarityBm25; - dfi?: SettingsSimilarityDfi; - dfr?: SettingsSimilarityDfr; - ib?: SettingsSimilarityIb; - lmd?: SettingsSimilarityLmd; - lmj?: SettingsSimilarityLmj; - scripted_tfidf?: SettingsSimilarityScriptedTfidf; +export interface IndexSettingsSimilarity { + bm25?: IndexSettingsSimilarityBm25; + dfi?: IndexSettingsSimilarityDfi; + dfr?: IndexSettingsSimilarityDfr; + ib?: IndexSettingsSimilarityIb; + lmd?: IndexSettingsSimilarityLmd; + lmj?: IndexSettingsSimilarityLmj; + scripted_tfidf?: IndexSettingsSimilarityScriptedTfidf; } -export interface SettingsSimilarityBm25 { +export interface IndexSettingsSimilarityBm25 { b: number; discount_overlaps: boolean; k1: number; type: 'BM25'; } -export interface SettingsSimilarityDfi { +export interface IndexSettingsSimilarityDfi { independence_measure: Common.DFIIndependenceMeasure; type: 'DFI'; } -export interface SettingsSimilarityDfr { +export interface IndexSettingsSimilarityDfr { after_effect: Common.DFRAfterEffect; basic_model: Common.DFRBasicModel; - normalization: Common.Normalization; + normalization: Common.TermFrequencyNormalization; type: 'DFR'; } -export interface SettingsSimilarityIb { +export interface IndexSettingsSimilarityIb { distribution: Common.IBDistribution; lambda: Common.IBLambda; - normalization: Common.Normalization; + normalization: Common.TermFrequencyNormalization; type: 'IB'; } -export interface SettingsSimilarityLmd { +export interface IndexSettingsSimilarityLmd { mu: number; type: 'LMDirichlet'; } -export interface SettingsSimilarityLmj { +export interface IndexSettingsSimilarityLmj { lambda: number; type: 'LMJelinekMercer'; } -export interface SettingsSimilarityScriptedTfidf { +export interface IndexSettingsSimilarityScriptedTfidf { script: Common.Script; type: 'scripted'; } -export interface SlowlogSettings { +export interface IndexSettingsStore { + allow_mmap?: boolean; + type: StorageType; +} + +export interface IndexSettingsTimeSeries { + end_time?: Common.DateTime; + start_time?: Common.DateTime; +} + +export interface IndexState { + aliases?: Record; + data_stream?: Common.DataStreamName; + defaults?: IndexSettings; + mappings?: Common_Mapping.TypeMapping; + settings?: IndexSettings; +} + +export interface IndexTemplate { + _meta?: Common.Metadata; + allow_auto_create?: boolean; + composed_of?: Common.Name[]; + data_stream?: IndexTemplateDataStreamConfiguration; + index_patterns: Common.Names; + priority?: number; + template?: IndexTemplateSummary; + version?: Common.VersionNumber; +} + +export interface IndexTemplateDataStreamConfiguration { + allow_custom_routing?: boolean; + hidden?: boolean; + timestamp_field?: DataStreamTimestampField; +} + +export interface IndexTemplateSummary { + aliases?: Record; + mappings?: Common_Mapping.TypeMapping; + settings?: IndexSettings; +} + +export interface IndexVersioning { + created?: Common.VersionString; + created_string?: string; +} + +export type ManagedBy = 'Data stream lifecycle' | 'Index Lifecycle Management' | 'Unmanaged' + +export interface NumericFielddata { + format: NumericFielddataFormat; +} + +export type NumericFielddataFormat = 'array' | 'disabled' + +export interface RetentionLease { + period: Common.Duration; +} + +export interface SearchIdle { + after?: Common.Duration; +} + +export interface SearchSlowlog { level?: string; reformat?: boolean; - source?: number; - threshold?: SlowlogThresholds; + threshold?: SearchSlowlogThresholds; } +export interface SearchSlowlogThresholds { + fetch?: SlowlogThresholdLevels; + query?: SlowlogThresholdLevels; +} + +export type SegmentSortMissing = '_first' | '_last' + +export type SegmentSortMode = 'max' | 'min' + +export type SegmentSortOrder = 'asc' | 'desc' + export interface SlowlogThresholdLevels { debug?: Common.Duration; info?: Common.Duration; @@ -458,21 +459,11 @@ export interface SlowlogThresholdLevels { warn?: Common.Duration; } -export interface SlowlogThresholds { - fetch?: SlowlogThresholdLevels; - query?: SlowlogThresholdLevels; -} - export interface SoftDeletes { enabled?: boolean; retention_lease?: RetentionLease; } -export interface Storage { - allow_mmap?: boolean; - type: StorageType; -} - export type StorageType = 'fs' | 'hybridfs' | 'mmapfs' | 'niofs' export interface TemplateMapping { @@ -491,7 +482,7 @@ export interface Translog { sync_interval?: Common.Duration; } -export type TranslogDurability = 'async' | 'request' +export type TranslogDurability = 'ASYNC' | 'REQUEST' | 'async' | 'request' export interface TranslogRetention { age?: Common.Duration; diff --git a/api/_types/indices.put_index_template.d.ts b/api/_types/indices.put_index_template.d.ts index 0c3b02871..52d2b37f8 100644 --- a/api/_types/indices.put_index_template.d.ts +++ b/api/_types/indices.put_index_template.d.ts @@ -19,7 +19,6 @@ import * as Indices_Common from './indices._common' export interface IndexTemplateMapping { aliases?: Record; - lifecycle?: Indices_Common.DataStreamLifecycle; mappings?: Common_Mapping.TypeMapping; settings?: Indices_Common.IndexSettings; } diff --git a/api/index.d.ts b/api/index.d.ts index b28c15357..94d97075f 100644 --- a/api/index.d.ts +++ b/api/index.d.ts @@ -17,6 +17,7 @@ import { Info_Request, Info_Response, Info_ResponseBody } from './_core/info'; import { Ping_Request, Ping_Response, Ping_ResponseBody } from './_core/ping'; import { Bulk_Request, Bulk_RequestBody, Bulk_Response, Bulk_ResponseBody } from './_core/bulk'; +import { BulkStream_Request, BulkStream_RequestBody, BulkStream_Response, BulkStream_ResponseBody } from './_core/bulkStream'; import { Count_Request, Count_RequestBody, Count_Response, Count_ResponseBody } from './_core/count'; import { DeleteByQueryRethrottle_Request, DeleteByQueryRethrottle_Response, DeleteByQueryRethrottle_ResponseBody } from './_core/deleteByQueryRethrottle'; import { FieldCaps_Request, FieldCaps_RequestBody, FieldCaps_Response, FieldCaps_ResponseBody } from './_core/fieldCaps'; @@ -352,6 +353,7 @@ export { Info_Request, Info_Response, Info_ResponseBody, Ping_Request, Ping_Response, Ping_ResponseBody, Bulk_Request, Bulk_RequestBody, Bulk_Response, Bulk_ResponseBody, + BulkStream_Request, BulkStream_RequestBody, BulkStream_Response, BulkStream_ResponseBody, Count_Request, Count_RequestBody, Count_Response, Count_ResponseBody, DeleteByQueryRethrottle_Request, DeleteByQueryRethrottle_Response, DeleteByQueryRethrottle_ResponseBody, FieldCaps_Request, FieldCaps_RequestBody, FieldCaps_Response, FieldCaps_ResponseBody,