elasticsearch 8.17.1__py3-none-any.whl → 8.17.2__py3-none-any.whl
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.
- elasticsearch/__init__.py +2 -2
- elasticsearch/_async/client/__init__.py +1971 -779
- elasticsearch/_async/client/async_search.py +33 -22
- elasticsearch/_async/client/autoscaling.py +27 -21
- elasticsearch/_async/client/cat.py +216 -141
- elasticsearch/_async/client/ccr.py +96 -70
- elasticsearch/_async/client/cluster.py +150 -142
- elasticsearch/_async/client/connector.py +182 -86
- elasticsearch/_async/client/dangling_indices.py +19 -13
- elasticsearch/_async/client/enrich.py +25 -6
- elasticsearch/_async/client/eql.py +22 -9
- elasticsearch/_async/client/esql.py +295 -3
- elasticsearch/_async/client/features.py +25 -25
- elasticsearch/_async/client/fleet.py +15 -9
- elasticsearch/_async/client/graph.py +9 -8
- elasticsearch/_async/client/ilm.py +85 -55
- elasticsearch/_async/client/indices.py +692 -549
- elasticsearch/_async/client/inference.py +32 -28
- elasticsearch/_async/client/ingest.py +61 -22
- elasticsearch/_async/client/license.py +48 -31
- elasticsearch/_async/client/logstash.py +17 -6
- elasticsearch/_async/client/migration.py +23 -14
- elasticsearch/_async/client/ml.py +532 -284
- elasticsearch/_async/client/monitoring.py +5 -2
- elasticsearch/_async/client/nodes.py +43 -27
- elasticsearch/_async/client/query_rules.py +51 -25
- elasticsearch/_async/client/rollup.py +111 -73
- elasticsearch/_async/client/search_application.py +49 -21
- elasticsearch/_async/client/searchable_snapshots.py +21 -8
- elasticsearch/_async/client/security.py +810 -472
- elasticsearch/_async/client/shutdown.py +31 -26
- elasticsearch/_async/client/simulate.py +16 -22
- elasticsearch/_async/client/slm.py +55 -30
- elasticsearch/_async/client/snapshot.py +173 -192
- elasticsearch/_async/client/sql.py +37 -16
- elasticsearch/_async/client/ssl.py +16 -17
- elasticsearch/_async/client/synonyms.py +50 -29
- elasticsearch/_async/client/tasks.py +74 -39
- elasticsearch/_async/client/text_structure.py +61 -52
- elasticsearch/_async/client/transform.py +108 -79
- elasticsearch/_async/client/watcher.py +93 -57
- elasticsearch/_async/client/xpack.py +16 -7
- elasticsearch/_async/helpers.py +1 -1
- elasticsearch/_sync/client/__init__.py +1971 -779
- elasticsearch/_sync/client/async_search.py +33 -22
- elasticsearch/_sync/client/autoscaling.py +27 -21
- elasticsearch/_sync/client/cat.py +216 -141
- elasticsearch/_sync/client/ccr.py +96 -70
- elasticsearch/_sync/client/cluster.py +150 -142
- elasticsearch/_sync/client/connector.py +182 -86
- elasticsearch/_sync/client/dangling_indices.py +19 -13
- elasticsearch/_sync/client/enrich.py +25 -6
- elasticsearch/_sync/client/eql.py +22 -9
- elasticsearch/_sync/client/esql.py +295 -3
- elasticsearch/_sync/client/features.py +25 -25
- elasticsearch/_sync/client/fleet.py +15 -9
- elasticsearch/_sync/client/graph.py +9 -8
- elasticsearch/_sync/client/ilm.py +85 -55
- elasticsearch/_sync/client/indices.py +692 -549
- elasticsearch/_sync/client/inference.py +32 -28
- elasticsearch/_sync/client/ingest.py +61 -22
- elasticsearch/_sync/client/license.py +48 -31
- elasticsearch/_sync/client/logstash.py +17 -6
- elasticsearch/_sync/client/migration.py +23 -14
- elasticsearch/_sync/client/ml.py +532 -284
- elasticsearch/_sync/client/monitoring.py +5 -2
- elasticsearch/_sync/client/nodes.py +43 -27
- elasticsearch/_sync/client/query_rules.py +51 -25
- elasticsearch/_sync/client/rollup.py +111 -73
- elasticsearch/_sync/client/search_application.py +49 -21
- elasticsearch/_sync/client/searchable_snapshots.py +21 -8
- elasticsearch/_sync/client/security.py +810 -472
- elasticsearch/_sync/client/shutdown.py +31 -26
- elasticsearch/_sync/client/simulate.py +16 -22
- elasticsearch/_sync/client/slm.py +55 -30
- elasticsearch/_sync/client/snapshot.py +173 -192
- elasticsearch/_sync/client/sql.py +37 -16
- elasticsearch/_sync/client/ssl.py +16 -17
- elasticsearch/_sync/client/synonyms.py +50 -29
- elasticsearch/_sync/client/tasks.py +74 -39
- elasticsearch/_sync/client/text_structure.py +61 -52
- elasticsearch/_sync/client/transform.py +108 -79
- elasticsearch/_sync/client/utils.py +1 -1
- elasticsearch/_sync/client/watcher.py +93 -57
- elasticsearch/_sync/client/xpack.py +16 -7
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +2 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.17.2.dist-info}/METADATA +1 -1
- elasticsearch-8.17.2.dist-info/RECORD +119 -0
- elasticsearch-8.17.1.dist-info/RECORD +0 -119
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.17.2.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.17.2.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.17.2.dist-info}/licenses/NOTICE +0 -0
|
@@ -55,8 +55,11 @@ class IndicesClient(NamespacedClient):
|
|
|
55
55
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
56
56
|
) -> ObjectApiResponse[t.Any]:
|
|
57
57
|
"""
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
.. raw:: html
|
|
59
|
+
|
|
60
|
+
<p>Add an index block.
|
|
61
|
+
Limits the operations allowed on an index by blocking specific operation types.</p>
|
|
62
|
+
|
|
60
63
|
|
|
61
64
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/index-modules-blocks.html>`_
|
|
62
65
|
|
|
@@ -143,12 +146,15 @@ class IndicesClient(NamespacedClient):
|
|
|
143
146
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
144
147
|
) -> ObjectApiResponse[t.Any]:
|
|
145
148
|
"""
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
.. raw:: html
|
|
150
|
+
|
|
151
|
+
<p>Get tokens from text analysis.
|
|
152
|
+
The analyze API performs analysis on a text string and returns the resulting tokens.</p>
|
|
153
|
+
<p>Generating excessive amount of tokens may cause a node to run out of memory.
|
|
154
|
+
The <code>index.analyze.max_token_count</code> setting enables you to limit the number of tokens that can be produced.
|
|
155
|
+
If more than this limit of tokens gets generated, an error occurs.
|
|
156
|
+
The <code>_analyze</code> endpoint without a specified index will always use <code>10000</code> as its limit.</p>
|
|
157
|
+
|
|
152
158
|
|
|
153
159
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-analyze.html>`_
|
|
154
160
|
|
|
@@ -249,11 +255,15 @@ class IndicesClient(NamespacedClient):
|
|
|
249
255
|
request: t.Optional[bool] = None,
|
|
250
256
|
) -> ObjectApiResponse[t.Any]:
|
|
251
257
|
"""
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
258
|
+
.. raw:: html
|
|
259
|
+
|
|
260
|
+
<p>Clear the cache.
|
|
261
|
+
Clear the cache of one or more indices.
|
|
262
|
+
For data streams, the API clears the caches of the stream's backing indices.</p>
|
|
263
|
+
<p>By default, the clear cache API clears all caches.
|
|
264
|
+
To clear only specific caches, use the <code>fielddata</code>, <code>query</code>, or <code>request</code> parameters.
|
|
265
|
+
To clear the cache only of specific fields, use the <code>fields</code> parameter.</p>
|
|
266
|
+
|
|
257
267
|
|
|
258
268
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-clearcache.html>`_
|
|
259
269
|
|
|
@@ -338,44 +348,44 @@ class IndicesClient(NamespacedClient):
|
|
|
338
348
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
339
349
|
) -> ObjectApiResponse[t.Any]:
|
|
340
350
|
"""
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
351
|
+
.. raw:: html
|
|
352
|
+
|
|
353
|
+
<p>Clone an index.
|
|
354
|
+
Clone an existing index into a new index.
|
|
355
|
+
Each original primary shard is cloned into a new primary shard in the new index.</p>
|
|
356
|
+
<p>IMPORTANT: Elasticsearch does not apply index templates to the resulting index.
|
|
357
|
+
The API also does not copy index metadata from the original index.
|
|
358
|
+
Index metadata includes aliases, index lifecycle management phase definitions, and cross-cluster replication (CCR) follower information.
|
|
359
|
+
For example, if you clone a CCR follower index, the resulting clone will not be a follower index.</p>
|
|
360
|
+
<p>The clone API copies most index settings from the source index to the resulting index, with the exception of <code>index.number_of_replicas</code> and <code>index.auto_expand_replicas</code>.
|
|
361
|
+
To set the number of replicas in the resulting index, configure these settings in the clone request.</p>
|
|
362
|
+
<p>Cloning works as follows:</p>
|
|
363
|
+
<ul>
|
|
364
|
+
<li>First, it creates a new target index with the same definition as the source index.</li>
|
|
365
|
+
<li>Then it hard-links segments from the source index into the target index. If the file system does not support hard-linking, all segments are copied into the new index, which is a much more time consuming process.</li>
|
|
366
|
+
<li>Finally, it recovers the target index as though it were a closed index which had just been re-opened.</li>
|
|
367
|
+
</ul>
|
|
368
|
+
<p>IMPORTANT: Indices can only be cloned if they meet the following requirements:</p>
|
|
369
|
+
<ul>
|
|
370
|
+
<li>The index must be marked as read-only and have a cluster health status of green.</li>
|
|
371
|
+
<li>The target index must not exist.</li>
|
|
372
|
+
<li>The source index must have the same number of primary shards as the target index.</li>
|
|
373
|
+
<li>The node handling the clone process must have sufficient free disk space to accommodate a second copy of the existing index.</li>
|
|
374
|
+
</ul>
|
|
375
|
+
<p>The current write index on a data stream cannot be cloned.
|
|
376
|
+
In order to clone the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be cloned.</p>
|
|
377
|
+
<p>NOTE: Mappings cannot be specified in the <code>_clone</code> request. The mappings of the source index will be used for the target index.</p>
|
|
378
|
+
<p><strong>Monitor the cloning process</strong></p>
|
|
379
|
+
<p>The cloning process can be monitored with the cat recovery API or the cluster health API can be used to wait until all primary shards have been allocated by setting the <code>wait_for_status</code> parameter to <code>yellow</code>.</p>
|
|
380
|
+
<p>The <code>_clone</code> API returns as soon as the target index has been added to the cluster state, before any shards have been allocated.
|
|
381
|
+
At this point, all shards are in the state unassigned.
|
|
382
|
+
If, for any reason, the target index can't be allocated, its primary shard will remain unassigned until it can be allocated on that node.</p>
|
|
383
|
+
<p>Once the primary shard is allocated, it moves to state initializing, and the clone process begins.
|
|
384
|
+
When the clone operation completes, the shard will become active.
|
|
385
|
+
At that point, Elasticsearch will try to allocate any replicas and may decide to relocate the primary shard to another node.</p>
|
|
386
|
+
<p><strong>Wait for active shards</strong></p>
|
|
387
|
+
<p>Because the clone operation creates a new index to clone the shards to, the wait for active shards setting on index creation applies to the clone index action as well.</p>
|
|
388
|
+
|
|
379
389
|
|
|
380
390
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-clone-index.html>`_
|
|
381
391
|
|
|
@@ -463,24 +473,23 @@ class IndicesClient(NamespacedClient):
|
|
|
463
473
|
] = None,
|
|
464
474
|
) -> ObjectApiResponse[t.Any]:
|
|
465
475
|
"""
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
with the cluster settings API by setting `cluster.indices.close.enable` to `false`.
|
|
476
|
+
.. raw:: html
|
|
477
|
+
|
|
478
|
+
<p>Close an index.
|
|
479
|
+
A closed index is blocked for read or write operations and does not allow all operations that opened indices allow.
|
|
480
|
+
It is not possible to index documents or to search for documents in a closed index.
|
|
481
|
+
Closed indices do not have to maintain internal data structures for indexing or searching documents, which results in a smaller overhead on the cluster.</p>
|
|
482
|
+
<p>When opening or closing an index, the master node is responsible for restarting the index shards to reflect the new state of the index.
|
|
483
|
+
The shards will then go through the normal recovery process.
|
|
484
|
+
The data of opened and closed indices is automatically replicated by the cluster to ensure that enough shard copies are safely kept around at all times.</p>
|
|
485
|
+
<p>You can open and close multiple indices.
|
|
486
|
+
An error is thrown if the request explicitly refers to a missing index.
|
|
487
|
+
This behaviour can be turned off using the <code>ignore_unavailable=true</code> parameter.</p>
|
|
488
|
+
<p>By default, you must explicitly name the indices you are opening or closing.
|
|
489
|
+
To open or close indices with <code>_all</code>, <code>*</code>, or other wildcard expressions, change the<code> action.destructive_requires_name</code> setting to <code>false</code>. This setting can also be changed with the cluster update settings API.</p>
|
|
490
|
+
<p>Closed indices consume a significant amount of disk-space which can cause problems in managed environments.
|
|
491
|
+
Closing indices can be turned off with the cluster settings API by setting <code>cluster.indices.close.enable</code> to <code>false</code>.</p>
|
|
492
|
+
|
|
484
493
|
|
|
485
494
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-close.html>`_
|
|
486
495
|
|
|
@@ -561,26 +570,27 @@ class IndicesClient(NamespacedClient):
|
|
|
561
570
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
562
571
|
) -> ObjectApiResponse[t.Any]:
|
|
563
572
|
"""
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
573
|
+
.. raw:: html
|
|
574
|
+
|
|
575
|
+
<p>Create an index.
|
|
576
|
+
You can use the create index API to add a new index to an Elasticsearch cluster.
|
|
577
|
+
When creating an index, you can specify the following:</p>
|
|
578
|
+
<ul>
|
|
579
|
+
<li>Settings for the index.</li>
|
|
580
|
+
<li>Mappings for fields in the index.</li>
|
|
581
|
+
<li>Index aliases</li>
|
|
582
|
+
</ul>
|
|
583
|
+
<p><strong>Wait for active shards</strong></p>
|
|
584
|
+
<p>By default, index creation will only return a response to the client when the primary copies of each shard have been started, or the request times out.
|
|
585
|
+
The index creation response will indicate what happened.
|
|
586
|
+
For example, <code>acknowledged</code> indicates whether the index was successfully created in the cluster, <code>while shards_acknowledged</code> indicates whether the requisite number of shard copies were started for each shard in the index before timing out.
|
|
587
|
+
Note that it is still possible for either <code>acknowledged</code> or <code>shards_acknowledged</code> to be <code>false</code>, but for the index creation to be successful.
|
|
588
|
+
These values simply indicate whether the operation completed before the timeout.
|
|
589
|
+
If <code>acknowledged</code> is false, the request timed out before the cluster state was updated with the newly created index, but it probably will be created sometime soon.
|
|
590
|
+
If <code>shards_acknowledged</code> is false, then the request timed out before the requisite number of shards were started (by default just the primaries), even if the cluster state was successfully updated to reflect the newly created index (that is to say, <code>acknowledged</code> is <code>true</code>).</p>
|
|
591
|
+
<p>You can change the default of only waiting for the primary shards to start through the index setting <code>index.write.wait_for_active_shards</code>.
|
|
592
|
+
Note that changing this setting will also affect the <code>wait_for_active_shards</code> value on all subsequent write operations.</p>
|
|
593
|
+
|
|
584
594
|
|
|
585
595
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-create-index.html>`_
|
|
586
596
|
|
|
@@ -653,8 +663,12 @@ class IndicesClient(NamespacedClient):
|
|
|
653
663
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
654
664
|
) -> ObjectApiResponse[t.Any]:
|
|
655
665
|
"""
|
|
656
|
-
|
|
657
|
-
|
|
666
|
+
.. raw:: html
|
|
667
|
+
|
|
668
|
+
<p>Create a data stream.
|
|
669
|
+
Creates a data stream.
|
|
670
|
+
You must have a matching index template with data stream enabled.</p>
|
|
671
|
+
|
|
658
672
|
|
|
659
673
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
|
|
660
674
|
|
|
@@ -715,7 +729,11 @@ class IndicesClient(NamespacedClient):
|
|
|
715
729
|
pretty: t.Optional[bool] = None,
|
|
716
730
|
) -> ObjectApiResponse[t.Any]:
|
|
717
731
|
"""
|
|
718
|
-
|
|
732
|
+
.. raw:: html
|
|
733
|
+
|
|
734
|
+
<p>Get data stream stats.
|
|
735
|
+
Retrieves statistics for one or more data streams.</p>
|
|
736
|
+
|
|
719
737
|
|
|
720
738
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
|
|
721
739
|
|
|
@@ -776,11 +794,15 @@ class IndicesClient(NamespacedClient):
|
|
|
776
794
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
777
795
|
) -> ObjectApiResponse[t.Any]:
|
|
778
796
|
"""
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
797
|
+
.. raw:: html
|
|
798
|
+
|
|
799
|
+
<p>Delete indices.
|
|
800
|
+
Deleting an index deletes its documents, shards, and metadata.
|
|
801
|
+
It does not delete related Kibana components, such as data views, visualizations, or dashboards.</p>
|
|
802
|
+
<p>You cannot delete the current write index of a data stream.
|
|
803
|
+
To delete the index, you must roll over the data stream so a new write index is created.
|
|
804
|
+
You can then use the delete index API to delete the previous write index.</p>
|
|
805
|
+
|
|
784
806
|
|
|
785
807
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-index.html>`_
|
|
786
808
|
|
|
@@ -850,7 +872,11 @@ class IndicesClient(NamespacedClient):
|
|
|
850
872
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
851
873
|
) -> ObjectApiResponse[t.Any]:
|
|
852
874
|
"""
|
|
853
|
-
|
|
875
|
+
.. raw:: html
|
|
876
|
+
|
|
877
|
+
<p>Delete an alias.
|
|
878
|
+
Removes a data stream or index from an alias.</p>
|
|
879
|
+
|
|
854
880
|
|
|
855
881
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-alias.html>`_
|
|
856
882
|
|
|
@@ -914,8 +940,11 @@ class IndicesClient(NamespacedClient):
|
|
|
914
940
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
915
941
|
) -> ObjectApiResponse[t.Any]:
|
|
916
942
|
"""
|
|
917
|
-
|
|
918
|
-
|
|
943
|
+
.. raw:: html
|
|
944
|
+
|
|
945
|
+
<p>Delete data stream lifecycles.
|
|
946
|
+
Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle.</p>
|
|
947
|
+
|
|
919
948
|
|
|
920
949
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-delete-lifecycle.html>`_
|
|
921
950
|
|
|
@@ -975,7 +1004,11 @@ class IndicesClient(NamespacedClient):
|
|
|
975
1004
|
pretty: t.Optional[bool] = None,
|
|
976
1005
|
) -> ObjectApiResponse[t.Any]:
|
|
977
1006
|
"""
|
|
978
|
-
|
|
1007
|
+
.. raw:: html
|
|
1008
|
+
|
|
1009
|
+
<p>Delete data streams.
|
|
1010
|
+
Deletes one or more data streams and their backing indices.</p>
|
|
1011
|
+
|
|
979
1012
|
|
|
980
1013
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
|
|
981
1014
|
|
|
@@ -1027,10 +1060,13 @@ class IndicesClient(NamespacedClient):
|
|
|
1027
1060
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1028
1061
|
) -> ObjectApiResponse[t.Any]:
|
|
1029
1062
|
"""
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1063
|
+
.. raw:: html
|
|
1064
|
+
|
|
1065
|
+
<p>Delete an index template.
|
|
1066
|
+
The provided <!-- raw HTML omitted --> may contain multiple template names separated by a comma. If multiple template
|
|
1067
|
+
names are specified then there is no wildcard support and the provided names should match completely with
|
|
1068
|
+
existing templates.</p>
|
|
1069
|
+
|
|
1034
1070
|
|
|
1035
1071
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-template.html>`_
|
|
1036
1072
|
|
|
@@ -1082,7 +1118,10 @@ class IndicesClient(NamespacedClient):
|
|
|
1082
1118
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1083
1119
|
) -> ObjectApiResponse[t.Any]:
|
|
1084
1120
|
"""
|
|
1085
|
-
|
|
1121
|
+
.. raw:: html
|
|
1122
|
+
|
|
1123
|
+
<p>Delete a legacy index template.</p>
|
|
1124
|
+
|
|
1086
1125
|
|
|
1087
1126
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-template-v1.html>`_
|
|
1088
1127
|
|
|
@@ -1145,16 +1184,16 @@ class IndicesClient(NamespacedClient):
|
|
|
1145
1184
|
run_expensive_tasks: t.Optional[bool] = None,
|
|
1146
1185
|
) -> ObjectApiResponse[t.Any]:
|
|
1147
1186
|
"""
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1187
|
+
.. raw:: html
|
|
1188
|
+
|
|
1189
|
+
<p>Analyze the index disk usage.
|
|
1190
|
+
Analyze the disk usage of each field of an index or data stream.
|
|
1191
|
+
This API might not support indices created in previous Elasticsearch versions.
|
|
1192
|
+
The result of a small index can be inaccurate as some parts of an index might not be analyzed by the API.</p>
|
|
1193
|
+
<p>NOTE: The total size of fields of the analyzed shards of the index in the response is usually smaller than the index <code>store_size</code> value because some small metadata files are ignored and some parts of data files might not be scanned by the API.
|
|
1194
|
+
Since stored fields are stored together in a compressed format, the sizes of stored fields are also estimates and can be inaccurate.
|
|
1195
|
+
The stored size of the <code>_id</code> field is likely underestimated while the <code>_source</code> field is overestimated.</p>
|
|
1196
|
+
|
|
1158
1197
|
|
|
1159
1198
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-disk-usage.html>`_
|
|
1160
1199
|
|
|
@@ -1228,14 +1267,16 @@ class IndicesClient(NamespacedClient):
|
|
|
1228
1267
|
pretty: t.Optional[bool] = None,
|
|
1229
1268
|
) -> ObjectApiResponse[t.Any]:
|
|
1230
1269
|
"""
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1270
|
+
.. raw:: html
|
|
1271
|
+
|
|
1272
|
+
<p>Downsample an index.
|
|
1273
|
+
Aggregate a time series (TSDS) index and store pre-computed statistical summaries (<code>min</code>, <code>max</code>, <code>sum</code>, <code>value_count</code> and <code>avg</code>) for each metric field grouped by a configured time interval.
|
|
1274
|
+
For example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index.
|
|
1275
|
+
All documents within an hour interval are summarized and stored as a single document in the downsample index.</p>
|
|
1276
|
+
<p>NOTE: Only indices in a time series data stream are supported.
|
|
1277
|
+
Neither field nor document level security can be defined on the source index.
|
|
1278
|
+
The source index must be read only (<code>index.blocks.write: true</code>).</p>
|
|
1279
|
+
|
|
1239
1280
|
|
|
1240
1281
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-downsample-data-stream.html>`_
|
|
1241
1282
|
|
|
@@ -1303,7 +1344,11 @@ class IndicesClient(NamespacedClient):
|
|
|
1303
1344
|
pretty: t.Optional[bool] = None,
|
|
1304
1345
|
) -> HeadApiResponse:
|
|
1305
1346
|
"""
|
|
1306
|
-
|
|
1347
|
+
.. raw:: html
|
|
1348
|
+
|
|
1349
|
+
<p>Check indices.
|
|
1350
|
+
Check if one or more indices, index aliases, or data streams exist.</p>
|
|
1351
|
+
|
|
1307
1352
|
|
|
1308
1353
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-exists.html>`_
|
|
1309
1354
|
|
|
@@ -1381,7 +1426,11 @@ class IndicesClient(NamespacedClient):
|
|
|
1381
1426
|
pretty: t.Optional[bool] = None,
|
|
1382
1427
|
) -> HeadApiResponse:
|
|
1383
1428
|
"""
|
|
1384
|
-
|
|
1429
|
+
.. raw:: html
|
|
1430
|
+
|
|
1431
|
+
<p>Check aliases.
|
|
1432
|
+
Checks if one or more data stream or index aliases exist.</p>
|
|
1433
|
+
|
|
1385
1434
|
|
|
1386
1435
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html>`_
|
|
1387
1436
|
|
|
@@ -1451,7 +1500,11 @@ class IndicesClient(NamespacedClient):
|
|
|
1451
1500
|
pretty: t.Optional[bool] = None,
|
|
1452
1501
|
) -> HeadApiResponse:
|
|
1453
1502
|
"""
|
|
1454
|
-
|
|
1503
|
+
.. raw:: html
|
|
1504
|
+
|
|
1505
|
+
<p>Check index templates.
|
|
1506
|
+
Check whether index templates exist.</p>
|
|
1507
|
+
|
|
1455
1508
|
|
|
1456
1509
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/index-templates.html>`_
|
|
1457
1510
|
|
|
@@ -1500,11 +1553,13 @@ class IndicesClient(NamespacedClient):
|
|
|
1500
1553
|
pretty: t.Optional[bool] = None,
|
|
1501
1554
|
) -> HeadApiResponse:
|
|
1502
1555
|
"""
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1556
|
+
.. raw:: html
|
|
1557
|
+
|
|
1558
|
+
<p>Check existence of index templates.
|
|
1559
|
+
Get information about whether index templates exist.
|
|
1560
|
+
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.</p>
|
|
1561
|
+
<p>IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.</p>
|
|
1562
|
+
|
|
1508
1563
|
|
|
1509
1564
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-template-exists-v1.html>`_
|
|
1510
1565
|
|
|
@@ -1558,10 +1613,11 @@ class IndicesClient(NamespacedClient):
|
|
|
1558
1613
|
pretty: t.Optional[bool] = None,
|
|
1559
1614
|
) -> ObjectApiResponse[t.Any]:
|
|
1560
1615
|
"""
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1616
|
+
.. raw:: html
|
|
1617
|
+
|
|
1618
|
+
<p>Get the status for a data stream lifecycle.
|
|
1619
|
+
Get information about an index or data stream's current data stream lifecycle status, such as time since index creation, time since rollover, the lifecycle configuration managing the index, or any errors encountered during lifecycle execution.</p>
|
|
1620
|
+
|
|
1565
1621
|
|
|
1566
1622
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-explain-lifecycle.html>`_
|
|
1567
1623
|
|
|
@@ -1625,13 +1681,15 @@ class IndicesClient(NamespacedClient):
|
|
|
1625
1681
|
] = None,
|
|
1626
1682
|
) -> ObjectApiResponse[t.Any]:
|
|
1627
1683
|
"""
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1684
|
+
.. raw:: html
|
|
1685
|
+
|
|
1686
|
+
<p>Get field usage stats.
|
|
1687
|
+
Get field usage information for each shard and field of an index.
|
|
1688
|
+
Field usage statistics are automatically captured when queries are running on a cluster.
|
|
1689
|
+
A shard-level search request that accesses a given field, even if multiple times during that request, is counted as a single use.</p>
|
|
1690
|
+
<p>The response body reports the per-shard usage count of the data structures that back the fields in the index.
|
|
1691
|
+
A given request will increment each count by a maximum value of 1, even if the request accesses the same field multiple times.</p>
|
|
1692
|
+
|
|
1635
1693
|
|
|
1636
1694
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/field-usage-stats.html>`_
|
|
1637
1695
|
|
|
@@ -1719,22 +1777,18 @@ class IndicesClient(NamespacedClient):
|
|
|
1719
1777
|
wait_if_ongoing: t.Optional[bool] = None,
|
|
1720
1778
|
) -> ObjectApiResponse[t.Any]:
|
|
1721
1779
|
"""
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
flush on one or more indices using the flush API, although it is rare for users
|
|
1735
|
-
to need to call this API directly. If you call the flush API after indexing some
|
|
1736
|
-
documents then a successful response indicates that Elasticsearch has flushed
|
|
1737
|
-
all the documents that were indexed before the flush API was called.
|
|
1780
|
+
.. raw:: html
|
|
1781
|
+
|
|
1782
|
+
<p>Flush data streams or indices.
|
|
1783
|
+
Flushing a data stream or index is the process of making sure that any data that is currently only stored in the transaction log is also permanently stored in the Lucene index.
|
|
1784
|
+
When restarting, Elasticsearch replays any unflushed operations from the transaction log into the Lucene index to bring it back into the state that it was in before the restart.
|
|
1785
|
+
Elasticsearch automatically triggers flushes as needed, using heuristics that trade off the size of the unflushed transaction log against the cost of performing each flush.</p>
|
|
1786
|
+
<p>After each operation has been flushed it is permanently stored in the Lucene index.
|
|
1787
|
+
This may mean that there is no need to maintain an additional copy of it in the transaction log.
|
|
1788
|
+
The transaction log is made up of multiple files, called generations, and Elasticsearch will delete any generation files when they are no longer needed, freeing up disk space.</p>
|
|
1789
|
+
<p>It is also possible to trigger a flush on one or more indices using the flush API, although it is rare for users to need to call this API directly.
|
|
1790
|
+
If you call the flush API after indexing some documents then a successful response indicates that Elasticsearch has flushed all the documents that were indexed before the flush API was called.</p>
|
|
1791
|
+
|
|
1738
1792
|
|
|
1739
1793
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-flush.html>`_
|
|
1740
1794
|
|
|
@@ -1817,49 +1871,49 @@ class IndicesClient(NamespacedClient):
|
|
|
1817
1871
|
wait_for_completion: t.Optional[bool] = None,
|
|
1818
1872
|
) -> ObjectApiResponse[t.Any]:
|
|
1819
1873
|
"""
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1874
|
+
.. raw:: html
|
|
1875
|
+
|
|
1876
|
+
<p>Force a merge.
|
|
1877
|
+
Perform the force merge operation on the shards of one or more indices.
|
|
1878
|
+
For data streams, the API forces a merge on the shards of the stream's backing indices.</p>
|
|
1879
|
+
<p>Merging reduces the number of segments in each shard by merging some of them together and also frees up the space used by deleted documents.
|
|
1880
|
+
Merging normally happens automatically, but sometimes it is useful to trigger a merge manually.</p>
|
|
1881
|
+
<p>WARNING: We recommend force merging only a read-only index (meaning the index is no longer receiving writes).
|
|
1882
|
+
When documents are updated or deleted, the old version is not immediately removed but instead soft-deleted and marked with a "tombstone".
|
|
1883
|
+
These soft-deleted documents are automatically cleaned up during regular segment merges.
|
|
1884
|
+
But force merge can cause very large (greater than 5 GB) segments to be produced, which are not eligible for regular merges.
|
|
1885
|
+
So the number of soft-deleted documents can then grow rapidly, resulting in higher disk usage and worse search performance.
|
|
1886
|
+
If you regularly force merge an index receiving writes, this can also make snapshots more expensive, since the new documents can't be backed up incrementally.</p>
|
|
1887
|
+
<p><strong>Blocks during a force merge</strong></p>
|
|
1888
|
+
<p>Calls to this API block until the merge is complete (unless request contains <code>wait_for_completion=false</code>).
|
|
1889
|
+
If the client connection is lost before completion then the force merge process will continue in the background.
|
|
1890
|
+
Any new requests to force merge the same indices will also block until the ongoing force merge is complete.</p>
|
|
1891
|
+
<p><strong>Running force merge asynchronously</strong></p>
|
|
1892
|
+
<p>If the request contains <code>wait_for_completion=false</code>, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to get the status of the task.
|
|
1893
|
+
However, you can not cancel this task as the force merge task is not cancelable.
|
|
1894
|
+
Elasticsearch creates a record of this task as a document at <code>_tasks/<task_id></code>.
|
|
1895
|
+
When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space.</p>
|
|
1896
|
+
<p><strong>Force merging multiple indices</strong></p>
|
|
1897
|
+
<p>You can force merge multiple indices with a single request by targeting:</p>
|
|
1898
|
+
<ul>
|
|
1899
|
+
<li>One or more data streams that contain multiple backing indices</li>
|
|
1900
|
+
<li>Multiple indices</li>
|
|
1901
|
+
<li>One or more aliases</li>
|
|
1902
|
+
<li>All data streams and indices in a cluster</li>
|
|
1903
|
+
</ul>
|
|
1904
|
+
<p>Each targeted shard is force-merged separately using the force_merge threadpool.
|
|
1905
|
+
By default each node only has a single <code>force_merge</code> thread which means that the shards on that node are force-merged one at a time.
|
|
1906
|
+
If you expand the <code>force_merge</code> threadpool on a node then it will force merge its shards in parallel</p>
|
|
1907
|
+
<p>Force merge makes the storage for the shard being merged temporarily increase, as it may require free space up to triple its size in case <code>max_num_segments parameter</code> is set to <code>1</code>, to rewrite all segments into a new one.</p>
|
|
1908
|
+
<p><strong>Data streams and time-based indices</strong></p>
|
|
1909
|
+
<p>Force-merging is useful for managing a data stream's older backing indices and other time-based indices, particularly after a rollover.
|
|
1910
|
+
In these cases, each index only receives indexing traffic for a certain period of time.
|
|
1911
|
+
Once an index receive no more writes, its shards can be force-merged to a single segment.
|
|
1912
|
+
This can be a good idea because single-segment shards can sometimes use simpler and more efficient data structures to perform searches.
|
|
1913
|
+
For example:</p>
|
|
1914
|
+
<pre><code>POST /.ds-my-data-stream-2099.03.07-000001/_forcemerge?max_num_segments=1
|
|
1915
|
+
</code></pre>
|
|
1916
|
+
|
|
1863
1917
|
|
|
1864
1918
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-forcemerge.html>`_
|
|
1865
1919
|
|
|
@@ -1952,8 +2006,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1952
2006
|
pretty: t.Optional[bool] = None,
|
|
1953
2007
|
) -> ObjectApiResponse[t.Any]:
|
|
1954
2008
|
"""
|
|
1955
|
-
|
|
1956
|
-
|
|
2009
|
+
.. raw:: html
|
|
2010
|
+
|
|
2011
|
+
<p>Get index information.
|
|
2012
|
+
Get information about one or more indices. For data streams, the API returns information about the
|
|
2013
|
+
stream’s backing indices.</p>
|
|
2014
|
+
|
|
1957
2015
|
|
|
1958
2016
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-index.html>`_
|
|
1959
2017
|
|
|
@@ -2042,7 +2100,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2042
2100
|
pretty: t.Optional[bool] = None,
|
|
2043
2101
|
) -> ObjectApiResponse[t.Any]:
|
|
2044
2102
|
"""
|
|
2045
|
-
|
|
2103
|
+
.. raw:: html
|
|
2104
|
+
|
|
2105
|
+
<p>Get aliases.
|
|
2106
|
+
Retrieves information for one or more data stream or index aliases.</p>
|
|
2107
|
+
|
|
2046
2108
|
|
|
2047
2109
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-alias.html>`_
|
|
2048
2110
|
|
|
@@ -2124,8 +2186,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2124
2186
|
pretty: t.Optional[bool] = None,
|
|
2125
2187
|
) -> ObjectApiResponse[t.Any]:
|
|
2126
2188
|
"""
|
|
2127
|
-
|
|
2128
|
-
|
|
2189
|
+
.. raw:: html
|
|
2190
|
+
|
|
2191
|
+
<p>Get data stream lifecycles.
|
|
2192
|
+
Retrieves the data stream lifecycle configuration of one or more data streams.</p>
|
|
2193
|
+
|
|
2129
2194
|
|
|
2130
2195
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-get-lifecycle.html>`_
|
|
2131
2196
|
|
|
@@ -2179,8 +2244,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2179
2244
|
pretty: t.Optional[bool] = None,
|
|
2180
2245
|
) -> ObjectApiResponse[t.Any]:
|
|
2181
2246
|
"""
|
|
2182
|
-
|
|
2183
|
-
|
|
2247
|
+
.. raw:: html
|
|
2248
|
+
|
|
2249
|
+
<p>Get data stream lifecycle stats.
|
|
2250
|
+
Get statistics about the data streams that are managed by a data stream lifecycle.</p>
|
|
2251
|
+
|
|
2184
2252
|
|
|
2185
2253
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-get-lifecycle-stats.html>`_
|
|
2186
2254
|
"""
|
|
@@ -2227,7 +2295,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2227
2295
|
verbose: t.Optional[bool] = None,
|
|
2228
2296
|
) -> ObjectApiResponse[t.Any]:
|
|
2229
2297
|
"""
|
|
2230
|
-
|
|
2298
|
+
.. raw:: html
|
|
2299
|
+
|
|
2300
|
+
<p>Get data streams.
|
|
2301
|
+
Retrieves information about one or more data streams.</p>
|
|
2302
|
+
|
|
2231
2303
|
|
|
2232
2304
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
|
|
2233
2305
|
|
|
@@ -2302,10 +2374,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2302
2374
|
pretty: t.Optional[bool] = None,
|
|
2303
2375
|
) -> ObjectApiResponse[t.Any]:
|
|
2304
2376
|
"""
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2377
|
+
.. raw:: html
|
|
2378
|
+
|
|
2379
|
+
<p>Get mapping definitions.
|
|
2380
|
+
Retrieves mapping definitions for one or more fields.
|
|
2381
|
+
For data streams, the API retrieves field mappings for the stream’s backing indices.</p>
|
|
2382
|
+
<p>This API is useful if you don't need a complete mapping or if an index mapping contains a large number of fields.</p>
|
|
2383
|
+
|
|
2309
2384
|
|
|
2310
2385
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-field-mapping.html>`_
|
|
2311
2386
|
|
|
@@ -2382,7 +2457,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2382
2457
|
pretty: t.Optional[bool] = None,
|
|
2383
2458
|
) -> ObjectApiResponse[t.Any]:
|
|
2384
2459
|
"""
|
|
2385
|
-
|
|
2460
|
+
.. raw:: html
|
|
2461
|
+
|
|
2462
|
+
<p>Get index templates.
|
|
2463
|
+
Get information about one or more index templates.</p>
|
|
2464
|
+
|
|
2386
2465
|
|
|
2387
2466
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-template.html>`_
|
|
2388
2467
|
|
|
@@ -2455,8 +2534,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2455
2534
|
pretty: t.Optional[bool] = None,
|
|
2456
2535
|
) -> ObjectApiResponse[t.Any]:
|
|
2457
2536
|
"""
|
|
2458
|
-
|
|
2459
|
-
|
|
2537
|
+
.. raw:: html
|
|
2538
|
+
|
|
2539
|
+
<p>Get mapping definitions.
|
|
2540
|
+
For data streams, the API retrieves mappings for the stream’s backing indices.</p>
|
|
2541
|
+
|
|
2460
2542
|
|
|
2461
2543
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-mapping.html>`_
|
|
2462
2544
|
|
|
@@ -2540,8 +2622,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2540
2622
|
pretty: t.Optional[bool] = None,
|
|
2541
2623
|
) -> ObjectApiResponse[t.Any]:
|
|
2542
2624
|
"""
|
|
2543
|
-
|
|
2544
|
-
|
|
2625
|
+
.. raw:: html
|
|
2626
|
+
|
|
2627
|
+
<p>Get index settings.
|
|
2628
|
+
Get setting information for one or more indices.
|
|
2629
|
+
For data streams, it returns setting information for the stream's backing indices.</p>
|
|
2630
|
+
|
|
2545
2631
|
|
|
2546
2632
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-settings.html>`_
|
|
2547
2633
|
|
|
@@ -2628,9 +2714,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2628
2714
|
pretty: t.Optional[bool] = None,
|
|
2629
2715
|
) -> ObjectApiResponse[t.Any]:
|
|
2630
2716
|
"""
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2717
|
+
.. raw:: html
|
|
2718
|
+
|
|
2719
|
+
<p>Get index templates.
|
|
2720
|
+
Get information about one or more index templates.</p>
|
|
2721
|
+
<p>IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.</p>
|
|
2722
|
+
|
|
2634
2723
|
|
|
2635
2724
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-template-v1.html>`_
|
|
2636
2725
|
|
|
@@ -2689,14 +2778,20 @@ class IndicesClient(NamespacedClient):
|
|
|
2689
2778
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
2690
2779
|
) -> ObjectApiResponse[t.Any]:
|
|
2691
2780
|
"""
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2781
|
+
.. raw:: html
|
|
2782
|
+
|
|
2783
|
+
<p>Convert an index alias to a data stream.
|
|
2784
|
+
Converts an index alias to a data stream.
|
|
2785
|
+
You must have a matching index template that is data stream enabled.
|
|
2786
|
+
The alias must meet the following criteria:
|
|
2787
|
+
The alias must have a write index;
|
|
2788
|
+
All indices for the alias must have a <code>@timestamp</code> field mapping of a <code>date</code> or <code>date_nanos</code> field type;
|
|
2789
|
+
The alias must not have any filters;
|
|
2790
|
+
The alias must not use custom routing.
|
|
2791
|
+
If successful, the request removes the alias and creates a data stream with the same name.
|
|
2792
|
+
The indices for the alias become hidden backing indices for the stream.
|
|
2793
|
+
The write index for the alias becomes the write index for the stream.</p>
|
|
2794
|
+
|
|
2700
2795
|
|
|
2701
2796
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
|
|
2702
2797
|
|
|
@@ -2748,8 +2843,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2748
2843
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2749
2844
|
) -> ObjectApiResponse[t.Any]:
|
|
2750
2845
|
"""
|
|
2751
|
-
|
|
2752
|
-
|
|
2846
|
+
.. raw:: html
|
|
2847
|
+
|
|
2848
|
+
<p>Update data streams.
|
|
2849
|
+
Performs one or more data stream modification actions in a single atomic operation.</p>
|
|
2850
|
+
|
|
2753
2851
|
|
|
2754
2852
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
|
|
2755
2853
|
|
|
@@ -2809,27 +2907,26 @@ class IndicesClient(NamespacedClient):
|
|
|
2809
2907
|
] = None,
|
|
2810
2908
|
) -> ObjectApiResponse[t.Any]:
|
|
2811
2909
|
"""
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
well.
|
|
2910
|
+
.. raw:: html
|
|
2911
|
+
|
|
2912
|
+
<p>Open a closed index.
|
|
2913
|
+
For data streams, the API opens any closed backing indices.</p>
|
|
2914
|
+
<p>A closed index is blocked for read/write operations and does not allow all operations that opened indices allow.
|
|
2915
|
+
It is not possible to index documents or to search for documents in a closed index.
|
|
2916
|
+
This allows closed indices to not have to maintain internal data structures for indexing or searching documents, resulting in a smaller overhead on the cluster.</p>
|
|
2917
|
+
<p>When opening or closing an index, the master is responsible for restarting the index shards to reflect the new state of the index.
|
|
2918
|
+
The shards will then go through the normal recovery process.
|
|
2919
|
+
The data of opened or closed indices is automatically replicated by the cluster to ensure that enough shard copies are safely kept around at all times.</p>
|
|
2920
|
+
<p>You can open and close multiple indices.
|
|
2921
|
+
An error is thrown if the request explicitly refers to a missing index.
|
|
2922
|
+
This behavior can be turned off by using the <code>ignore_unavailable=true</code> parameter.</p>
|
|
2923
|
+
<p>By default, you must explicitly name the indices you are opening or closing.
|
|
2924
|
+
To open or close indices with <code>_all</code>, <code>*</code>, or other wildcard expressions, change the <code>action.destructive_requires_name</code> setting to <code>false</code>.
|
|
2925
|
+
This setting can also be changed with the cluster update settings API.</p>
|
|
2926
|
+
<p>Closed indices consume a significant amount of disk-space which can cause problems in managed environments.
|
|
2927
|
+
Closing indices can be turned off with the cluster settings API by setting <code>cluster.indices.close.enable</code> to <code>false</code>.</p>
|
|
2928
|
+
<p>Because opening or closing an index allocates its shards, the <code>wait_for_active_shards</code> setting on index creation applies to the <code>_open</code> and <code>_close</code> index actions as well.</p>
|
|
2929
|
+
|
|
2833
2930
|
|
|
2834
2931
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-open-close.html>`_
|
|
2835
2932
|
|
|
@@ -2904,18 +3001,18 @@ class IndicesClient(NamespacedClient):
|
|
|
2904
3001
|
pretty: t.Optional[bool] = None,
|
|
2905
3002
|
) -> ObjectApiResponse[t.Any]:
|
|
2906
3003
|
"""
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
3004
|
+
.. raw:: html
|
|
3005
|
+
|
|
3006
|
+
<p>Promote a data stream.
|
|
3007
|
+
Promote a data stream from a replicated data stream managed by cross-cluster replication (CCR) to a regular data stream.</p>
|
|
3008
|
+
<p>With CCR auto following, a data stream from a remote cluster can be replicated to the local cluster.
|
|
3009
|
+
These data streams can't be rolled over in the local cluster.
|
|
3010
|
+
These replicated data streams roll over only if the upstream data stream rolls over.
|
|
3011
|
+
In the event that the remote cluster is no longer available, the data stream in the local cluster can be promoted to a regular data stream, which allows these data streams to be rolled over in the local cluster.</p>
|
|
3012
|
+
<p>NOTE: When promoting a data stream, ensure the local cluster has a data stream enabled index template that matches the data stream.
|
|
3013
|
+
If this is missing, the data stream will not be able to roll over until a matching index template is created.
|
|
3014
|
+
This will affect the lifecycle management of the data stream and interfere with the data stream size and retention.</p>
|
|
3015
|
+
|
|
2919
3016
|
|
|
2920
3017
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
|
|
2921
3018
|
|
|
@@ -2977,7 +3074,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2977
3074
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2978
3075
|
) -> ObjectApiResponse[t.Any]:
|
|
2979
3076
|
"""
|
|
2980
|
-
|
|
3077
|
+
.. raw:: html
|
|
3078
|
+
|
|
3079
|
+
<p>Create or update an alias.
|
|
3080
|
+
Adds a data stream or index to an alias.</p>
|
|
3081
|
+
|
|
2981
3082
|
|
|
2982
3083
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html>`_
|
|
2983
3084
|
|
|
@@ -3079,8 +3180,11 @@ class IndicesClient(NamespacedClient):
|
|
|
3079
3180
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3080
3181
|
) -> ObjectApiResponse[t.Any]:
|
|
3081
3182
|
"""
|
|
3082
|
-
|
|
3083
|
-
|
|
3183
|
+
.. raw:: html
|
|
3184
|
+
|
|
3185
|
+
<p>Update data stream lifecycles.
|
|
3186
|
+
Update the data stream lifecycle of the specified data streams.</p>
|
|
3187
|
+
|
|
3084
3188
|
|
|
3085
3189
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-put-lifecycle.html>`_
|
|
3086
3190
|
|
|
@@ -3181,34 +3285,30 @@ class IndicesClient(NamespacedClient):
|
|
|
3181
3285
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3182
3286
|
) -> ObjectApiResponse[t.Any]:
|
|
3183
3287
|
"""
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
not only to field mappings, but also root options like `dynamic_templates` and
|
|
3209
|
-
`meta`. If an earlier component contains a `dynamic_templates` block, then by
|
|
3210
|
-
default new `dynamic_templates` entries are appended onto the end. If an entry
|
|
3211
|
-
already exists with the same key, then it is overwritten by the new definition.
|
|
3288
|
+
.. raw:: html
|
|
3289
|
+
|
|
3290
|
+
<p>Create or update an index template.
|
|
3291
|
+
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.</p>
|
|
3292
|
+
<p>Elasticsearch applies templates to new indices based on an wildcard pattern that matches the index name.
|
|
3293
|
+
Index templates are applied during data stream or index creation.
|
|
3294
|
+
For data streams, these settings and mappings are applied when the stream's backing indices are created.
|
|
3295
|
+
Settings and mappings specified in a create index API request override any settings or mappings specified in an index template.
|
|
3296
|
+
Changes to index templates do not affect existing indices, including the existing backing indices of a data stream.</p>
|
|
3297
|
+
<p>You can use C-style <code>/* *\\/</code> block comments in index templates.
|
|
3298
|
+
You can include comments anywhere in the request body, except before the opening curly bracket.</p>
|
|
3299
|
+
<p><strong>Multiple matching templates</strong></p>
|
|
3300
|
+
<p>If multiple index templates match the name of a new index or data stream, the template with the highest priority is used.</p>
|
|
3301
|
+
<p>Multiple templates with overlapping index patterns at the same priority are not allowed and an error will be thrown when attempting to create a template matching an existing index template at identical priorities.</p>
|
|
3302
|
+
<p><strong>Composing aliases, mappings, and settings</strong></p>
|
|
3303
|
+
<p>When multiple component templates are specified in the <code>composed_of</code> field for an index template, they are merged in the order specified, meaning that later component templates override earlier component templates.
|
|
3304
|
+
Any mappings, settings, or aliases from the parent index template are merged in next.
|
|
3305
|
+
Finally, any configuration on the index request itself is merged.
|
|
3306
|
+
Mapping definitions are merged recursively, which means that later mapping components can introduce new field mappings and update the mapping configuration.
|
|
3307
|
+
If a field mapping is already contained in an earlier component, its definition will be completely overwritten by the later one.
|
|
3308
|
+
This recursive merging strategy applies not only to field mappings, but also root options like <code>dynamic_templates</code> and <code>meta</code>.
|
|
3309
|
+
If an earlier component contains a <code>dynamic_templates</code> block, then by default new <code>dynamic_templates</code> entries are appended onto the end.
|
|
3310
|
+
If an entry already exists with the same key, then it is overwritten by the new definition.</p>
|
|
3311
|
+
|
|
3212
3312
|
|
|
3213
3313
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-put-template.html>`_
|
|
3214
3314
|
|
|
@@ -3341,10 +3441,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3341
3441
|
] = None,
|
|
3342
3442
|
dynamic_date_formats: t.Optional[t.Sequence[str]] = None,
|
|
3343
3443
|
dynamic_templates: t.Optional[
|
|
3344
|
-
t.
|
|
3345
|
-
t.Mapping[str, t.Mapping[str, t.Any]],
|
|
3346
|
-
t.Sequence[t.Mapping[str, t.Mapping[str, t.Any]]],
|
|
3347
|
-
]
|
|
3444
|
+
t.Sequence[t.Mapping[str, t.Mapping[str, t.Any]]]
|
|
3348
3445
|
] = None,
|
|
3349
3446
|
error_trace: t.Optional[bool] = None,
|
|
3350
3447
|
expand_wildcards: t.Optional[
|
|
@@ -3372,27 +3469,29 @@ class IndicesClient(NamespacedClient):
|
|
|
3372
3469
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3373
3470
|
) -> ObjectApiResponse[t.Any]:
|
|
3374
3471
|
"""
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3472
|
+
.. raw:: html
|
|
3473
|
+
|
|
3474
|
+
<p>Update field mappings.
|
|
3475
|
+
Add new fields to an existing data stream or index.
|
|
3476
|
+
You can also use this API to change the search settings of existing fields and add new properties to existing object fields.
|
|
3477
|
+
For data streams, these changes are applied to all backing indices by default.</p>
|
|
3478
|
+
<p><strong>Add multi-fields to an existing field</strong></p>
|
|
3479
|
+
<p>Multi-fields let you index the same field in different ways.
|
|
3480
|
+
You can use this API to update the fields mapping parameter and enable multi-fields for an existing field.
|
|
3481
|
+
WARNING: If an index (or data stream) contains documents when you add a multi-field, those documents will not have values for the new multi-field.
|
|
3482
|
+
You can populate the new multi-field with the update by query API.</p>
|
|
3483
|
+
<p><strong>Change supported mapping parameters for an existing field</strong></p>
|
|
3484
|
+
<p>The documentation for each mapping parameter indicates whether you can update it for an existing field using this API.
|
|
3485
|
+
For example, you can use the update mapping API to update the <code>ignore_above</code> parameter.</p>
|
|
3486
|
+
<p><strong>Change the mapping of an existing field</strong></p>
|
|
3487
|
+
<p>Except for supported mapping parameters, you can't change the mapping or field type of an existing field.
|
|
3488
|
+
Changing an existing field could invalidate data that's already indexed.</p>
|
|
3489
|
+
<p>If you need to change the mapping of a field in a data stream's backing indices, refer to documentation about modifying data streams.
|
|
3490
|
+
If you need to change the mapping of a field in other indices, create a new index with the correct mapping and reindex your data into that index.</p>
|
|
3491
|
+
<p><strong>Rename a field</strong></p>
|
|
3492
|
+
<p>Renaming a field would invalidate data already indexed under the old field name.
|
|
3493
|
+
Instead, add an alias field to create an alternate field name.</p>
|
|
3494
|
+
|
|
3396
3495
|
|
|
3397
3496
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-put-mapping.html>`_
|
|
3398
3497
|
|
|
@@ -3521,21 +3620,23 @@ class IndicesClient(NamespacedClient):
|
|
|
3521
3620
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3522
3621
|
) -> ObjectApiResponse[t.Any]:
|
|
3523
3622
|
"""
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3623
|
+
.. raw:: html
|
|
3624
|
+
|
|
3625
|
+
<p>Update index settings.
|
|
3626
|
+
Changes dynamic index settings in real time.
|
|
3627
|
+
For data streams, index setting changes are applied to all backing indices by default.</p>
|
|
3628
|
+
<p>To revert a setting to the default value, use a null value.
|
|
3629
|
+
The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation.
|
|
3630
|
+
To preserve existing settings from being updated, set the <code>preserve_existing</code> parameter to <code>true</code>.</p>
|
|
3631
|
+
<p>NOTE: You can only define new analyzers on closed indices.
|
|
3632
|
+
To add an analyzer, you must close the index, define the analyzer, and reopen the index.
|
|
3633
|
+
You cannot close the write index of a data stream.
|
|
3634
|
+
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.
|
|
3635
|
+
Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices.
|
|
3636
|
+
This affects searches and any new data added to the stream after the rollover.
|
|
3637
|
+
However, it does not affect the data stream's backing indices or their existing data.
|
|
3638
|
+
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.</p>
|
|
3639
|
+
|
|
3539
3640
|
|
|
3540
3641
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-update-settings.html>`_
|
|
3541
3642
|
|
|
@@ -3639,24 +3740,24 @@ class IndicesClient(NamespacedClient):
|
|
|
3639
3740
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3640
3741
|
) -> ObjectApiResponse[t.Any]:
|
|
3641
3742
|
"""
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3743
|
+
.. raw:: html
|
|
3744
|
+
|
|
3745
|
+
<p>Create or update an index template.
|
|
3746
|
+
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
|
|
3747
|
+
Elasticsearch applies templates to new indices based on an index pattern that matches the index name.</p>
|
|
3748
|
+
<p>IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.</p>
|
|
3749
|
+
<p>Composable templates always take precedence over legacy templates.
|
|
3750
|
+
If no composable template matches a new index, matching legacy templates are applied according to their order.</p>
|
|
3751
|
+
<p>Index templates are only applied during index creation.
|
|
3752
|
+
Changes to index templates do not affect existing indices.
|
|
3753
|
+
Settings and mappings specified in create index API requests override any settings or mappings specified in an index template.</p>
|
|
3754
|
+
<p>You can use C-style <code>/* *\\/</code> block comments in index templates.
|
|
3755
|
+
You can include comments anywhere in the request body, except before the opening curly bracket.</p>
|
|
3756
|
+
<p><strong>Indices matching multiple templates</strong></p>
|
|
3757
|
+
<p>Multiple index templates can potentially match an index, in this case, both the settings and mappings are merged into the final configuration of the index.
|
|
3758
|
+
The order of the merging can be controlled using the order parameter, with lower order being applied first, and higher orders overriding them.
|
|
3759
|
+
NOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order.</p>
|
|
3760
|
+
|
|
3660
3761
|
|
|
3661
3762
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-templates-v1.html>`_
|
|
3662
3763
|
|
|
@@ -3737,27 +3838,28 @@ class IndicesClient(NamespacedClient):
|
|
|
3737
3838
|
pretty: t.Optional[bool] = None,
|
|
3738
3839
|
) -> ObjectApiResponse[t.Any]:
|
|
3739
3840
|
"""
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3841
|
+
.. raw:: html
|
|
3842
|
+
|
|
3843
|
+
<p>Get index recovery information.
|
|
3844
|
+
Get information about ongoing and completed shard recoveries for one or more indices.
|
|
3845
|
+
For data streams, the API returns information for the stream's backing indices.</p>
|
|
3846
|
+
<p>All recoveries, whether ongoing or complete, are kept in the cluster state and may be reported on at any time.</p>
|
|
3847
|
+
<p>Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or creating a replica shard from a primary shard.
|
|
3848
|
+
When a shard recovery completes, the recovered shard is available for search and indexing.</p>
|
|
3849
|
+
<p>Recovery automatically occurs during the following processes:</p>
|
|
3850
|
+
<ul>
|
|
3851
|
+
<li>When creating an index for the first time.</li>
|
|
3852
|
+
<li>When a node rejoins the cluster and starts up any missing primary shard copies using the data that it holds in its data path.</li>
|
|
3853
|
+
<li>Creation of new replica shard copies from the primary.</li>
|
|
3854
|
+
<li>Relocation of a shard copy to a different node in the same cluster.</li>
|
|
3855
|
+
<li>A snapshot restore operation.</li>
|
|
3856
|
+
<li>A clone, shrink, or split operation.</li>
|
|
3857
|
+
</ul>
|
|
3858
|
+
<p>You can determine the cause of a shard recovery using the recovery or cat recovery APIs.</p>
|
|
3859
|
+
<p>The index recovery API reports information about completed recoveries only for shard copies that currently exist in the cluster.
|
|
3860
|
+
It only reports the last recovery for each shard copy and does not report historical information about earlier recoveries, nor does it report information about the recoveries of shard copies that no longer exist.
|
|
3861
|
+
This means that if a shard copy completes a recovery and then Elasticsearch relocates it onto a different node then the information about the original recovery will not be shown in the recovery API.</p>
|
|
3862
|
+
|
|
3761
3863
|
|
|
3762
3864
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-recovery.html>`_
|
|
3763
3865
|
|
|
@@ -3819,19 +3921,19 @@ class IndicesClient(NamespacedClient):
|
|
|
3819
3921
|
pretty: t.Optional[bool] = None,
|
|
3820
3922
|
) -> ObjectApiResponse[t.Any]:
|
|
3821
3923
|
"""
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3924
|
+
.. raw:: html
|
|
3925
|
+
|
|
3926
|
+
<p>Refresh an index.
|
|
3927
|
+
A refresh makes recent operations performed on one or more indices available for search.
|
|
3928
|
+
For data streams, the API runs the refresh operation on the stream’s backing indices.</p>
|
|
3929
|
+
<p>By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds.
|
|
3930
|
+
You can change this default interval with the <code>index.refresh_interval</code> setting.</p>
|
|
3931
|
+
<p>Refresh requests are synchronous and do not return a response until the refresh operation completes.</p>
|
|
3932
|
+
<p>Refreshes are resource-intensive.
|
|
3933
|
+
To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible.</p>
|
|
3934
|
+
<p>If your application workflow indexes documents and then runs a search to retrieve the indexed document, it's recommended to use the index API's <code>refresh=wait_for</code> query parameter option.
|
|
3935
|
+
This option ensures the indexing operation waits for a periodic refresh before running the search.</p>
|
|
3936
|
+
|
|
3835
3937
|
|
|
3836
3938
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-refresh.html>`_
|
|
3837
3939
|
|
|
@@ -3901,21 +4003,20 @@ class IndicesClient(NamespacedClient):
|
|
|
3901
4003
|
pretty: t.Optional[bool] = None,
|
|
3902
4004
|
) -> ObjectApiResponse[t.Any]:
|
|
3903
4005
|
"""
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
everywhere in the cluster in case shards are relocated in the future.
|
|
4006
|
+
.. raw:: html
|
|
4007
|
+
|
|
4008
|
+
<p>Reload search analyzers.
|
|
4009
|
+
Reload an index's search analyzers and their resources.
|
|
4010
|
+
For data streams, the API reloads search analyzers and resources for the stream's backing indices.</p>
|
|
4011
|
+
<p>IMPORTANT: After reloading the search analyzers you should clear the request cache to make sure it doesn't contain responses derived from the previous versions of the analyzer.</p>
|
|
4012
|
+
<p>You can use the reload search analyzers API to pick up changes to synonym files used in the <code>synonym_graph</code> or <code>synonym</code> token filter of a search analyzer.
|
|
4013
|
+
To be eligible, the token filter must have an <code>updateable</code> flag of <code>true</code> and only be used in search analyzers.</p>
|
|
4014
|
+
<p>NOTE: This API does not perform a reload for each shard of an index.
|
|
4015
|
+
Instead, it performs a reload for each node containing index shards.
|
|
4016
|
+
As a result, the total shard count returned by the API can differ from the number of index shards.
|
|
4017
|
+
Because reloading affects every node with an index shard, it is important to update the synonym file on every data node in the cluster--including nodes that don't contain a shard replica--before using this API.
|
|
4018
|
+
This ensures the synonym file is updated everywhere in the cluster in case shards are relocated in the future.</p>
|
|
4019
|
+
|
|
3919
4020
|
|
|
3920
4021
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-reload-analyzers.html>`_
|
|
3921
4022
|
|
|
@@ -3979,38 +4080,33 @@ class IndicesClient(NamespacedClient):
|
|
|
3979
4080
|
pretty: t.Optional[bool] = None,
|
|
3980
4081
|
) -> ObjectApiResponse[t.Any]:
|
|
3981
4082
|
"""
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
(combined with any query parameters you specify) will likely cause an exception
|
|
4010
|
-
to be thrown when you do the search. In these cases, the "error" field in the
|
|
4011
|
-
`_resolve/cluster` response will be present. (This is also where security/permission
|
|
4012
|
-
errors will be shown.) * A remote cluster is an older version that does not support
|
|
4013
|
-
the feature you want to use in your search.
|
|
4083
|
+
.. raw:: html
|
|
4084
|
+
|
|
4085
|
+
<p>Resolve the cluster.
|
|
4086
|
+
Resolve the specified index expressions to return information about each cluster, including the local cluster, if included.
|
|
4087
|
+
Multiple patterns and remote clusters are supported.</p>
|
|
4088
|
+
<p>This endpoint is useful before doing a cross-cluster search in order to determine which remote clusters should be included in a search.</p>
|
|
4089
|
+
<p>You use the same index expression with this endpoint as you would for cross-cluster search.
|
|
4090
|
+
Index and cluster exclusions are also supported with this endpoint.</p>
|
|
4091
|
+
<p>For each cluster in the index expression, information is returned about:</p>
|
|
4092
|
+
<ul>
|
|
4093
|
+
<li>Whether the querying ("local") cluster is currently connected to each remote cluster in the index expression scope.</li>
|
|
4094
|
+
<li>Whether each remote cluster is configured with <code>skip_unavailable</code> as <code>true</code> or <code>false</code>.</li>
|
|
4095
|
+
<li>Whether there are any indices, aliases, or data streams on that cluster that match the index expression.</li>
|
|
4096
|
+
<li>Whether the search is likely to have errors returned when you do the cross-cluster search (including any authorization errors if you do not have permission to query the index).</li>
|
|
4097
|
+
<li>Cluster version information, including the Elasticsearch server version.</li>
|
|
4098
|
+
</ul>
|
|
4099
|
+
<p>For example, <code>GET /_resolve/cluster/my-index-*,cluster*:my-index-*</code> returns information about the local cluster and all remotely configured clusters that start with the alias <code>cluster*</code>.
|
|
4100
|
+
Each cluster returns information about whether it has any indices, aliases or data streams that match <code>my-index-*</code>.</p>
|
|
4101
|
+
<p><strong>Advantages of using this endpoint before a cross-cluster search</strong></p>
|
|
4102
|
+
<p>You may want to exclude a cluster or index from a search when:</p>
|
|
4103
|
+
<ul>
|
|
4104
|
+
<li>A remote cluster is not currently connected and is configured with <code>skip_unavailable=false</code>. Running a cross-cluster search under those conditions will cause the entire search to fail.</li>
|
|
4105
|
+
<li>A cluster has no matching indices, aliases or data streams for the index expression (or your user does not have permissions to search them). For example, suppose your index expression is <code>logs*,remote1:logs*</code> and the remote1 cluster has no indices, aliases or data streams that match <code>logs*</code>. In that case, that cluster will return no results from that cluster if you include it in a cross-cluster search.</li>
|
|
4106
|
+
<li>The index expression (combined with any query parameters you specify) will likely cause an exception to be thrown when you do the search. In these cases, the "error" field in the <code>_resolve/cluster</code> response will be present. (This is also where security/permission errors will be shown.)</li>
|
|
4107
|
+
<li>A remote cluster is an older version that does not support the feature you want to use in your search.</li>
|
|
4108
|
+
</ul>
|
|
4109
|
+
|
|
4014
4110
|
|
|
4015
4111
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-resolve-cluster-api.html>`_
|
|
4016
4112
|
|
|
@@ -4083,8 +4179,12 @@ class IndicesClient(NamespacedClient):
|
|
|
4083
4179
|
pretty: t.Optional[bool] = None,
|
|
4084
4180
|
) -> ObjectApiResponse[t.Any]:
|
|
4085
4181
|
"""
|
|
4086
|
-
|
|
4087
|
-
|
|
4182
|
+
.. raw:: html
|
|
4183
|
+
|
|
4184
|
+
<p>Resolve indices.
|
|
4185
|
+
Resolve the names and/or index patterns for indices, aliases, and data streams.
|
|
4186
|
+
Multiple patterns and remote clusters are supported.</p>
|
|
4187
|
+
|
|
4088
4188
|
|
|
4089
4189
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-resolve-index-api.html>`_
|
|
4090
4190
|
|
|
@@ -4157,33 +4257,35 @@ class IndicesClient(NamespacedClient):
|
|
|
4157
4257
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4158
4258
|
) -> ObjectApiResponse[t.Any]:
|
|
4159
4259
|
"""
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4260
|
+
.. raw:: html
|
|
4261
|
+
|
|
4262
|
+
<p>Roll over to a new index.
|
|
4263
|
+
TIP: It is recommended to use the index lifecycle rollover action to automate rollovers.</p>
|
|
4264
|
+
<p>The rollover API creates a new index for a data stream or index alias.
|
|
4265
|
+
The API behavior depends on the rollover target.</p>
|
|
4266
|
+
<p><strong>Roll over a data stream</strong></p>
|
|
4267
|
+
<p>If you roll over a data stream, the API creates a new write index for the stream.
|
|
4268
|
+
The stream's previous write index becomes a regular backing index.
|
|
4269
|
+
A rollover also increments the data stream's generation.</p>
|
|
4270
|
+
<p><strong>Roll over an index alias with a write index</strong></p>
|
|
4271
|
+
<p>TIP: Prior to Elasticsearch 7.9, you'd typically use an index alias with a write index to manage time series data.
|
|
4272
|
+
Data streams replace this functionality, require less maintenance, and automatically integrate with data tiers.</p>
|
|
4273
|
+
<p>If an index alias points to multiple indices, one of the indices must be a write index.
|
|
4274
|
+
The rollover API creates a new write index for the alias with <code>is_write_index</code> set to <code>true</code>.
|
|
4275
|
+
The API also <code>sets is_write_index</code> to <code>false</code> for the previous write index.</p>
|
|
4276
|
+
<p><strong>Roll over an index alias with one index</strong></p>
|
|
4277
|
+
<p>If you roll over an index alias that points to only one index, the API creates a new index for the alias and removes the original index from the alias.</p>
|
|
4278
|
+
<p>NOTE: A rollover creates a new index and is subject to the <code>wait_for_active_shards</code> setting.</p>
|
|
4279
|
+
<p><strong>Increment index names for an alias</strong></p>
|
|
4280
|
+
<p>When you roll over an index alias, you can specify a name for the new index.
|
|
4281
|
+
If you don't specify a name and the current index ends with <code>-</code> and a number, such as <code>my-index-000001</code> or <code>my-index-3</code>, the new index name increments that number.
|
|
4282
|
+
For example, if you roll over an alias with a current index of <code>my-index-000001</code>, the rollover creates a new index named <code>my-index-000002</code>.
|
|
4283
|
+
This number is always six characters and zero-padded, regardless of the previous index's name.</p>
|
|
4284
|
+
<p>If you use an index alias for time series data, you can use date math in the index name to track the rollover date.
|
|
4285
|
+
For example, you can create an alias that points to an index named <code><my-index-{now/d}-000001></code>.
|
|
4286
|
+
If you create the index on May 6, 2099, the index's name is <code>my-index-2099.05.06-000001</code>.
|
|
4287
|
+
If you roll over the alias on May 7, 2099, the new index's name is <code>my-index-2099.05.07-000002</code>.</p>
|
|
4288
|
+
|
|
4187
4289
|
|
|
4188
4290
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-rollover-index.html>`_
|
|
4189
4291
|
|
|
@@ -4288,9 +4390,12 @@ class IndicesClient(NamespacedClient):
|
|
|
4288
4390
|
verbose: t.Optional[bool] = None,
|
|
4289
4391
|
) -> ObjectApiResponse[t.Any]:
|
|
4290
4392
|
"""
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4393
|
+
.. raw:: html
|
|
4394
|
+
|
|
4395
|
+
<p>Get index segments.
|
|
4396
|
+
Get low-level information about the Lucene segments in index shards.
|
|
4397
|
+
For data streams, the API returns information about the stream's backing indices.</p>
|
|
4398
|
+
|
|
4294
4399
|
|
|
4295
4400
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-segments.html>`_
|
|
4296
4401
|
|
|
@@ -4369,14 +4474,20 @@ class IndicesClient(NamespacedClient):
|
|
|
4369
4474
|
] = None,
|
|
4370
4475
|
) -> ObjectApiResponse[t.Any]:
|
|
4371
4476
|
"""
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4477
|
+
.. raw:: html
|
|
4478
|
+
|
|
4479
|
+
<p>Get index shard stores.
|
|
4480
|
+
Get store information about replica shards in one or more indices.
|
|
4481
|
+
For data streams, the API retrieves store information for the stream's backing indices.</p>
|
|
4482
|
+
<p>The index shard stores API returns the following information:</p>
|
|
4483
|
+
<ul>
|
|
4484
|
+
<li>The node on which each replica shard exists.</li>
|
|
4485
|
+
<li>The allocation ID for each replica shard.</li>
|
|
4486
|
+
<li>A unique ID for each replica shard.</li>
|
|
4487
|
+
<li>Any errors encountered while opening the shard index or from an earlier failure.</li>
|
|
4488
|
+
</ul>
|
|
4489
|
+
<p>By default, the API returns store information only for primary shards that are unassigned or have one or more unassigned replica shards.</p>
|
|
4490
|
+
|
|
4380
4491
|
|
|
4381
4492
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-shards-stores.html>`_
|
|
4382
4493
|
|
|
@@ -4447,39 +4558,38 @@ class IndicesClient(NamespacedClient):
|
|
|
4447
4558
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4448
4559
|
) -> ObjectApiResponse[t.Any]:
|
|
4449
4560
|
"""
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
index.
|
|
4561
|
+
.. raw:: html
|
|
4562
|
+
|
|
4563
|
+
<p>Shrink an index.
|
|
4564
|
+
Shrink an index into a new index with fewer primary shards.</p>
|
|
4565
|
+
<p>Before you can shrink an index:</p>
|
|
4566
|
+
<ul>
|
|
4567
|
+
<li>The index must be read-only.</li>
|
|
4568
|
+
<li>A copy of every shard in the index must reside on the same node.</li>
|
|
4569
|
+
<li>The index must have a green health status.</li>
|
|
4570
|
+
</ul>
|
|
4571
|
+
<p>To make shard allocation easier, we recommend you also remove the index's replica shards.
|
|
4572
|
+
You can later re-add replica shards as part of the shrink operation.</p>
|
|
4573
|
+
<p>The requested number of primary shards in the target index must be a factor of the number of shards in the source index.
|
|
4574
|
+
For example an index with 8 primary shards can be shrunk into 4, 2 or 1 primary shards or an index with 15 primary shards can be shrunk into 5, 3 or 1.
|
|
4575
|
+
If the number of shards in the index is a prime number it can only be shrunk into a single primary shard
|
|
4576
|
+
Before shrinking, a (primary or replica) copy of every shard in the index must be present on the same node.</p>
|
|
4577
|
+
<p>The current write index on a data stream cannot be shrunk. In order to shrink the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be shrunk.</p>
|
|
4578
|
+
<p>A shrink operation:</p>
|
|
4579
|
+
<ul>
|
|
4580
|
+
<li>Creates a new target index with the same definition as the source index, but with a smaller number of primary shards.</li>
|
|
4581
|
+
<li>Hard-links segments from the source index into the target index. If the file system does not support hard-linking, then all segments are copied into the new index, which is a much more time consuming process. Also if using multiple data paths, shards on different data paths require a full copy of segment files if they are not on the same disk since hardlinks do not work across disks.</li>
|
|
4582
|
+
<li>Recovers the target index as though it were a closed index which had just been re-opened. Recovers shards to the <code>.routing.allocation.initial_recovery._id</code> index setting.</li>
|
|
4583
|
+
</ul>
|
|
4584
|
+
<p>IMPORTANT: Indices can only be shrunk if they satisfy the following requirements:</p>
|
|
4585
|
+
<ul>
|
|
4586
|
+
<li>The target index must not exist.</li>
|
|
4587
|
+
<li>The source index must have more primary shards than the target index.</li>
|
|
4588
|
+
<li>The number of primary shards in the target index must be a factor of the number of primary shards in the source index. The source index must have more primary shards than the target index.</li>
|
|
4589
|
+
<li>The index must not contain more than 2,147,483,519 documents in total across all shards that will be shrunk into a single shard on the target index as this is the maximum number of docs that can fit into a single shard.</li>
|
|
4590
|
+
<li>The node handling the shrink process must have sufficient free disk space to accommodate a second copy of the existing index.</li>
|
|
4591
|
+
</ul>
|
|
4592
|
+
|
|
4483
4593
|
|
|
4484
4594
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-shrink-index.html>`_
|
|
4485
4595
|
|
|
@@ -4554,8 +4664,11 @@ class IndicesClient(NamespacedClient):
|
|
|
4554
4664
|
pretty: t.Optional[bool] = None,
|
|
4555
4665
|
) -> ObjectApiResponse[t.Any]:
|
|
4556
4666
|
"""
|
|
4557
|
-
|
|
4558
|
-
|
|
4667
|
+
.. raw:: html
|
|
4668
|
+
|
|
4669
|
+
<p>Simulate an index.
|
|
4670
|
+
Get the index configuration that would be applied to the specified index from an existing index template.</p>
|
|
4671
|
+
|
|
4559
4672
|
|
|
4560
4673
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-simulate-index.html>`_
|
|
4561
4674
|
|
|
@@ -4632,8 +4745,11 @@ class IndicesClient(NamespacedClient):
|
|
|
4632
4745
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4633
4746
|
) -> ObjectApiResponse[t.Any]:
|
|
4634
4747
|
"""
|
|
4635
|
-
|
|
4636
|
-
|
|
4748
|
+
.. raw:: html
|
|
4749
|
+
|
|
4750
|
+
<p>Simulate an index template.
|
|
4751
|
+
Get the index configuration that would be applied by a particular index template.</p>
|
|
4752
|
+
|
|
4637
4753
|
|
|
4638
4754
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-simulate-template.html>`_
|
|
4639
4755
|
|
|
@@ -4764,31 +4880,44 @@ class IndicesClient(NamespacedClient):
|
|
|
4764
4880
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4765
4881
|
) -> ObjectApiResponse[t.Any]:
|
|
4766
4882
|
"""
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4883
|
+
.. raw:: html
|
|
4884
|
+
|
|
4885
|
+
<p>Split an index.
|
|
4886
|
+
Split an index into a new index with more primary shards.</p>
|
|
4887
|
+
<ul>
|
|
4888
|
+
<li>
|
|
4889
|
+
<p>Before you can split an index:</p>
|
|
4890
|
+
</li>
|
|
4891
|
+
<li>
|
|
4892
|
+
<p>The index must be read-only.</p>
|
|
4893
|
+
</li>
|
|
4894
|
+
<li>
|
|
4895
|
+
<p>The cluster health status must be green.</p>
|
|
4896
|
+
</li>
|
|
4897
|
+
</ul>
|
|
4898
|
+
<p>You can do make an index read-only with the following request using the add index block API:</p>
|
|
4899
|
+
<pre><code>PUT /my_source_index/_block/write
|
|
4900
|
+
</code></pre>
|
|
4901
|
+
<p>The current write index on a data stream cannot be split.
|
|
4902
|
+
In order to split the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be split.</p>
|
|
4903
|
+
<p>The number of times the index can be split (and the number of shards that each original shard can be split into) is determined by the <code>index.number_of_routing_shards</code> setting.
|
|
4904
|
+
The number of routing shards specifies the hashing space that is used internally to distribute documents across shards with consistent hashing.
|
|
4905
|
+
For instance, a 5 shard index with <code>number_of_routing_shards</code> set to 30 (5 x 2 x 3) could be split by a factor of 2 or 3.</p>
|
|
4906
|
+
<p>A split operation:</p>
|
|
4907
|
+
<ul>
|
|
4908
|
+
<li>Creates a new target index with the same definition as the source index, but with a larger number of primary shards.</li>
|
|
4909
|
+
<li>Hard-links segments from the source index into the target index. If the file system doesn't support hard-linking, all segments are copied into the new index, which is a much more time consuming process.</li>
|
|
4910
|
+
<li>Hashes all documents again, after low level files are created, to delete documents that belong to a different shard.</li>
|
|
4911
|
+
<li>Recovers the target index as though it were a closed index which had just been re-opened.</li>
|
|
4912
|
+
</ul>
|
|
4913
|
+
<p>IMPORTANT: Indices can only be split if they satisfy the following requirements:</p>
|
|
4914
|
+
<ul>
|
|
4915
|
+
<li>The target index must not exist.</li>
|
|
4916
|
+
<li>The source index must have fewer primary shards than the target index.</li>
|
|
4917
|
+
<li>The number of primary shards in the target index must be a multiple of the number of primary shards in the source index.</li>
|
|
4918
|
+
<li>The node handling the split process must have sufficient free disk space to accommodate a second copy of the existing index.</li>
|
|
4919
|
+
</ul>
|
|
4920
|
+
|
|
4792
4921
|
|
|
4793
4922
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-split-index.html>`_
|
|
4794
4923
|
|
|
@@ -4880,14 +5009,17 @@ class IndicesClient(NamespacedClient):
|
|
|
4880
5009
|
pretty: t.Optional[bool] = None,
|
|
4881
5010
|
) -> ObjectApiResponse[t.Any]:
|
|
4882
5011
|
"""
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
5012
|
+
.. raw:: html
|
|
5013
|
+
|
|
5014
|
+
<p>Get index statistics.
|
|
5015
|
+
For data streams, the API retrieves statistics for the stream's backing indices.</p>
|
|
5016
|
+
<p>By default, the returned statistics are index-level with <code>primaries</code> and <code>total</code> aggregations.
|
|
5017
|
+
<code>primaries</code> are the values for only the primary shards.
|
|
5018
|
+
<code>total</code> are the accumulated values for both primary and replica shards.</p>
|
|
5019
|
+
<p>To get shard-level statistics, set the <code>level</code> parameter to <code>shards</code>.</p>
|
|
5020
|
+
<p>NOTE: When moving to another node, the shard-level statistics for a shard are cleared.
|
|
5021
|
+
Although the shard is no longer part of the node, that node retains any node-level statistics to which the shard contributed.</p>
|
|
5022
|
+
|
|
4891
5023
|
|
|
4892
5024
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-stats.html>`_
|
|
4893
5025
|
|
|
@@ -4990,8 +5122,11 @@ class IndicesClient(NamespacedClient):
|
|
|
4990
5122
|
wait_for_active_shards: t.Optional[str] = None,
|
|
4991
5123
|
) -> ObjectApiResponse[t.Any]:
|
|
4992
5124
|
"""
|
|
4993
|
-
|
|
4994
|
-
|
|
5125
|
+
.. raw:: html
|
|
5126
|
+
|
|
5127
|
+
<p>Unfreeze an index.
|
|
5128
|
+
When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.</p>
|
|
5129
|
+
|
|
4995
5130
|
|
|
4996
5131
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/unfreeze-index-api.html>`_
|
|
4997
5132
|
|
|
@@ -5065,7 +5200,11 @@ class IndicesClient(NamespacedClient):
|
|
|
5065
5200
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5066
5201
|
) -> ObjectApiResponse[t.Any]:
|
|
5067
5202
|
"""
|
|
5068
|
-
|
|
5203
|
+
.. raw:: html
|
|
5204
|
+
|
|
5205
|
+
<p>Create or update an alias.
|
|
5206
|
+
Adds a data stream or index to an alias.</p>
|
|
5207
|
+
|
|
5069
5208
|
|
|
5070
5209
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html>`_
|
|
5071
5210
|
|
|
@@ -5140,7 +5279,11 @@ class IndicesClient(NamespacedClient):
|
|
|
5140
5279
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5141
5280
|
) -> ObjectApiResponse[t.Any]:
|
|
5142
5281
|
"""
|
|
5143
|
-
|
|
5282
|
+
.. raw:: html
|
|
5283
|
+
|
|
5284
|
+
<p>Validate a query.
|
|
5285
|
+
Validates a query without running it.</p>
|
|
5286
|
+
|
|
5144
5287
|
|
|
5145
5288
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-validate.html>`_
|
|
5146
5289
|
|