@elastic/elasticsearch 9.2.0 → 9.3.0-unstable.20251027183018

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,6 +129,13 @@ export default class Indices {
129
129
  deleteIndexTemplate(this: That, params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDeleteIndexTemplateResponse>;
130
130
  deleteIndexTemplate(this: That, params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesDeleteIndexTemplateResponse, unknown>>;
131
131
  deleteIndexTemplate(this: That, params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions): Promise<T.IndicesDeleteIndexTemplateResponse>;
132
+ /**
133
+ * Delete sampling configuration for an index or data stream
134
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-sample-configuration | Elasticsearch API documentation}
135
+ */
136
+ deleteSampleConfiguration(this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>;
137
+ deleteSampleConfiguration(this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>;
138
+ deleteSampleConfiguration(this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>;
132
139
  /**
133
140
  * Delete a legacy index template. IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.
134
141
  * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-template | Elasticsearch API documentation}
@@ -290,6 +297,27 @@ export default class Indices {
290
297
  getMigrateReindexStatus(this: That, params: T.IndicesGetMigrateReindexStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetMigrateReindexStatusResponse>;
291
298
  getMigrateReindexStatus(this: That, params: T.IndicesGetMigrateReindexStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetMigrateReindexStatusResponse, unknown>>;
292
299
  getMigrateReindexStatus(this: That, params: T.IndicesGetMigrateReindexStatusRequest, options?: TransportRequestOptions): Promise<T.IndicesGetMigrateReindexStatusResponse>;
300
+ /**
301
+ * Request for a random sample of raw documents ingested into the given index or data stream.
302
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/group/ingest-random-sampling | Elasticsearch API documentation}
303
+ */
304
+ getSample(this: That, params: T.IndicesGetSampleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetSampleResponse>;
305
+ getSample(this: That, params: T.IndicesGetSampleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetSampleResponse, unknown>>;
306
+ getSample(this: That, params: T.IndicesGetSampleRequest, options?: TransportRequestOptions): Promise<T.IndicesGetSampleResponse>;
307
+ /**
308
+ * Get sampling configuration for an index or data stream
309
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-sample-configuration | Elasticsearch API documentation}
310
+ */
311
+ getSampleConfiguration(this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>;
312
+ getSampleConfiguration(this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>;
313
+ getSampleConfiguration(this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>;
314
+ /**
315
+ * Request stats for a random sample of raw documents ingested into the given index or data stream.
316
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/group/ingest-random-sampling | Elasticsearch API documentation}
317
+ */
318
+ getSampleStats(this: That, params: T.IndicesGetSampleStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetSampleStatsResponse>;
319
+ getSampleStats(this: That, params: T.IndicesGetSampleStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetSampleStatsResponse, unknown>>;
320
+ getSampleStats(this: That, params: T.IndicesGetSampleStatsRequest, options?: TransportRequestOptions): Promise<T.IndicesGetSampleStatsResponse>;
293
321
  /**
294
322
  * Get index settings. Get setting information for one or more indices. For data streams, it returns setting information for the stream's backing indices.
295
323
  * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-settings | Elasticsearch API documentation}
@@ -388,6 +416,13 @@ export default class Indices {
388
416
  putMapping(this: That, params: T.IndicesPutMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutMappingResponse>;
389
417
  putMapping(this: That, params: T.IndicesPutMappingRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutMappingResponse, unknown>>;
390
418
  putMapping(this: That, params: T.IndicesPutMappingRequest, options?: TransportRequestOptions): Promise<T.IndicesPutMappingResponse>;
419
+ /**
420
+ * Configure sampling for an index or data stream
421
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-sample-configuration | Elasticsearch API documentation}
422
+ */
423
+ putSampleConfiguration(this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>;
424
+ putSampleConfiguration(this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>;
425
+ putSampleConfiguration(this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>;
391
426
  /**
392
427
  * Update index settings. Changes dynamic index settings in real time. For data streams, index setting changes are applied to all backing indices by default. To revert a setting to the default value, use a null value. The list of per-index settings that can be updated dynamically on live indices can be found in index settings documentation. To preserve existing settings from being updated, set the `preserve_existing` parameter to `true`. For performance optimization during bulk indexing, you can disable the refresh interval. Refer to [disable refresh interval](https://www.elastic.co/docs/deploy-manage/production-guidance/optimize-performance/indexing-speed#disable-refresh-interval) for an example. There are multiple valid ways to represent index settings in the request body. You can specify only the setting, for example: ``` { "number_of_replicas": 1 } ``` Or you can use an `index` setting object: ``` { "index": { "number_of_replicas": 1 } } ``` Or you can use dot annotation: ``` { "index.number_of_replicas": 1 } ``` Or you can embed any of the aforementioned options in a `settings` object. For example: ``` { "settings": { "index": { "number_of_replicas": 1 } } } ``` NOTE: You can only define new analyzers on closed indices. To add an analyzer, you must close the index, define the analyzer, and reopen the index. You cannot close the write index of a data stream. To update the analyzer for a data stream's write index and future backing indices, update the analyzer in the index template used by the stream. Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices. This affects searches and any new data added to the stream after the rollover. However, it does not affect the data stream's backing indices or their existing data. To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it. Refer to [updating analyzers on existing indices](https://www.elastic.co/docs/manage-data/data-store/text-analysis/specify-an-analyzer#update-analyzers-on-existing-indices) for step-by-step examples.
393
428
  * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings | Elasticsearch API documentation}
@@ -218,6 +218,13 @@ class Indices {
218
218
  'timeout'
219
219
  ]
220
220
  },
221
+ 'indices.delete_sample_configuration': {
222
+ path: [
223
+ 'index'
224
+ ],
225
+ body: [],
226
+ query: []
227
+ },
221
228
  'indices.delete_template': {
222
229
  path: [
223
230
  'name'
@@ -480,6 +487,27 @@ class Indices {
480
487
  body: [],
481
488
  query: []
482
489
  },
490
+ 'indices.get_sample': {
491
+ path: [
492
+ 'index'
493
+ ],
494
+ body: [],
495
+ query: []
496
+ },
497
+ 'indices.get_sample_configuration': {
498
+ path: [
499
+ 'index'
500
+ ],
501
+ body: [],
502
+ query: []
503
+ },
504
+ 'indices.get_sample_stats': {
505
+ path: [
506
+ 'index'
507
+ ],
508
+ body: [],
509
+ query: []
510
+ },
483
511
  'indices.get_settings': {
484
512
  path: [
485
513
  'index',
@@ -673,6 +701,13 @@ class Indices {
673
701
  'write_index_only'
674
702
  ]
675
703
  },
704
+ 'indices.put_sample_configuration': {
705
+ path: [
706
+ 'index'
707
+ ],
708
+ body: [],
709
+ query: []
710
+ },
676
711
  'indices.put_settings': {
677
712
  path: [
678
713
  'index'
@@ -1666,6 +1701,42 @@ class Indices {
1666
1701
  };
1667
1702
  return await this.transport.request({ path, method, querystring, body, meta }, options);
1668
1703
  }
1704
+ async deleteSampleConfiguration(params, options) {
1705
+ const { path: acceptedPath } = this[client_1.kAcceptedParams]['indices.delete_sample_configuration'];
1706
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1707
+ const querystring = userQuery != null ? { ...userQuery } : {};
1708
+ let body;
1709
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1710
+ if (userBody != null) {
1711
+ if (typeof userBody === 'string') {
1712
+ body = userBody;
1713
+ }
1714
+ else {
1715
+ body = { ...userBody };
1716
+ }
1717
+ }
1718
+ params = params !== null && params !== void 0 ? params : {};
1719
+ for (const key in params) {
1720
+ if (acceptedPath.includes(key)) {
1721
+ continue;
1722
+ }
1723
+ else if (key !== 'body' && key !== 'querystring') {
1724
+ querystring[key] = params[key];
1725
+ }
1726
+ }
1727
+ const method = 'DELETE';
1728
+ const path = `/${encodeURIComponent(params.index.toString())}/_sample/config`;
1729
+ const meta = {
1730
+ name: 'indices.delete_sample_configuration',
1731
+ pathParts: {
1732
+ index: params.index
1733
+ },
1734
+ acceptedParams: [
1735
+ 'index'
1736
+ ]
1737
+ };
1738
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1739
+ }
1669
1740
  async deleteTemplate(params, options) {
1670
1741
  const { path: acceptedPath } = this[client_1.kAcceptedParams]['indices.delete_template'];
1671
1742
  const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
@@ -2657,6 +2728,114 @@ class Indices {
2657
2728
  };
2658
2729
  return await this.transport.request({ path, method, querystring, body, meta }, options);
2659
2730
  }
2731
+ async getSample(params, options) {
2732
+ const { path: acceptedPath } = this[client_1.kAcceptedParams]['indices.get_sample'];
2733
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2734
+ const querystring = userQuery != null ? { ...userQuery } : {};
2735
+ let body;
2736
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2737
+ if (userBody != null) {
2738
+ if (typeof userBody === 'string') {
2739
+ body = userBody;
2740
+ }
2741
+ else {
2742
+ body = { ...userBody };
2743
+ }
2744
+ }
2745
+ for (const key in params) {
2746
+ if (acceptedPath.includes(key)) {
2747
+ continue;
2748
+ }
2749
+ else if (key !== 'body' && key !== 'querystring') {
2750
+ // @ts-expect-error
2751
+ querystring[key] = params[key];
2752
+ }
2753
+ }
2754
+ const method = 'GET';
2755
+ const path = `/${encodeURIComponent(params.index.toString())}/_sample`;
2756
+ const meta = {
2757
+ name: 'indices.get_sample',
2758
+ pathParts: {
2759
+ index: params.index
2760
+ },
2761
+ acceptedParams: [
2762
+ 'index'
2763
+ ]
2764
+ };
2765
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
2766
+ }
2767
+ async getSampleConfiguration(params, options) {
2768
+ const { path: acceptedPath } = this[client_1.kAcceptedParams]['indices.get_sample_configuration'];
2769
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2770
+ const querystring = userQuery != null ? { ...userQuery } : {};
2771
+ let body;
2772
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2773
+ if (userBody != null) {
2774
+ if (typeof userBody === 'string') {
2775
+ body = userBody;
2776
+ }
2777
+ else {
2778
+ body = { ...userBody };
2779
+ }
2780
+ }
2781
+ params = params !== null && params !== void 0 ? params : {};
2782
+ for (const key in params) {
2783
+ if (acceptedPath.includes(key)) {
2784
+ continue;
2785
+ }
2786
+ else if (key !== 'body' && key !== 'querystring') {
2787
+ querystring[key] = params[key];
2788
+ }
2789
+ }
2790
+ const method = 'GET';
2791
+ const path = `/${encodeURIComponent(params.index.toString())}/_sample/config`;
2792
+ const meta = {
2793
+ name: 'indices.get_sample_configuration',
2794
+ pathParts: {
2795
+ index: params.index
2796
+ },
2797
+ acceptedParams: [
2798
+ 'index'
2799
+ ]
2800
+ };
2801
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
2802
+ }
2803
+ async getSampleStats(params, options) {
2804
+ const { path: acceptedPath } = this[client_1.kAcceptedParams]['indices.get_sample_stats'];
2805
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2806
+ const querystring = userQuery != null ? { ...userQuery } : {};
2807
+ let body;
2808
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2809
+ if (userBody != null) {
2810
+ if (typeof userBody === 'string') {
2811
+ body = userBody;
2812
+ }
2813
+ else {
2814
+ body = { ...userBody };
2815
+ }
2816
+ }
2817
+ for (const key in params) {
2818
+ if (acceptedPath.includes(key)) {
2819
+ continue;
2820
+ }
2821
+ else if (key !== 'body' && key !== 'querystring') {
2822
+ // @ts-expect-error
2823
+ querystring[key] = params[key];
2824
+ }
2825
+ }
2826
+ const method = 'GET';
2827
+ const path = `/${encodeURIComponent(params.index.toString())}/_sample/stats`;
2828
+ const meta = {
2829
+ name: 'indices.get_sample_stats',
2830
+ pathParts: {
2831
+ index: params.index
2832
+ },
2833
+ acceptedParams: [
2834
+ 'index'
2835
+ ]
2836
+ };
2837
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
2838
+ }
2660
2839
  async getSettings(params, options) {
2661
2840
  const { path: acceptedPath } = this[client_1.kAcceptedParams]['indices.get_settings'];
2662
2841
  const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
@@ -3348,6 +3527,42 @@ class Indices {
3348
3527
  };
3349
3528
  return await this.transport.request({ path, method, querystring, body, meta }, options);
3350
3529
  }
3530
+ async putSampleConfiguration(params, options) {
3531
+ const { path: acceptedPath } = this[client_1.kAcceptedParams]['indices.put_sample_configuration'];
3532
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
3533
+ const querystring = userQuery != null ? { ...userQuery } : {};
3534
+ let body;
3535
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
3536
+ if (userBody != null) {
3537
+ if (typeof userBody === 'string') {
3538
+ body = userBody;
3539
+ }
3540
+ else {
3541
+ body = { ...userBody };
3542
+ }
3543
+ }
3544
+ params = params !== null && params !== void 0 ? params : {};
3545
+ for (const key in params) {
3546
+ if (acceptedPath.includes(key)) {
3547
+ continue;
3548
+ }
3549
+ else if (key !== 'body' && key !== 'querystring') {
3550
+ querystring[key] = params[key];
3551
+ }
3552
+ }
3553
+ const method = 'PUT';
3554
+ const path = `/${encodeURIComponent(params.index.toString())}/_sample/config`;
3555
+ const meta = {
3556
+ name: 'indices.put_sample_configuration',
3557
+ pathParts: {
3558
+ index: params.index
3559
+ },
3560
+ acceptedParams: [
3561
+ 'index'
3562
+ ]
3563
+ };
3564
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
3565
+ }
3351
3566
  async putSettings(params, options) {
3352
3567
  var _b;
3353
3568
  const { path: acceptedPath, body: acceptedBody, query: acceptedQuery } = this[client_1.kAcceptedParams]['indices.put_settings'];