Skip to content

Commit 7e29cbf

Browse files
Auto-generated API code
1 parent 6a2dbcd commit 7e29cbf

File tree

15 files changed

+248
-120
lines changed

15 files changed

+248
-120
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,8 @@ async def bulk(
637637
Imagine a <code>_bulk?refresh=wait_for</code> request with three documents in it that happen to be routed to different shards in an index with five shards.
638638
The request will only wait for those three shards to refresh.
639639
The other two shards that make up the index do not participate in the <code>_bulk</code> request at all.</p>
640+
<p>You might want to disable the refresh interval temporarily to improve indexing throughput for large bulk requests.
641+
Refer to the linked documentation for step-by-step instructions using the index settings API.</p>
640642
641643
642644
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-bulk>`_
@@ -5867,7 +5869,8 @@ async def termvectors(
58675869
The information is only retrieved for the shard the requested document resides in.
58685870
The term and field statistics are therefore only useful as relative measures whereas the absolute numbers have no meaning in this context.
58695871
By default, when requesting term vectors of artificial documents, a shard to get the statistics from is randomly selected.
5870-
Use <code>routing</code> only to hit a particular shard.</p>
5872+
Use <code>routing</code> only to hit a particular shard.
5873+
Refer to the linked documentation for detailed examples of how to use this API.</p>
58715874
58725875
58735876
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-termvectors>`_

elasticsearch/_async/client/cluster.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ async def allocation_explain(
5151
Get explanations for shard allocations in the cluster.
5252
For unassigned shards, it provides an explanation for why the shard is unassigned.
5353
For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node.
54-
This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.</p>
54+
This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.
55+
Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API.</p>
5556
5657
5758
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cluster-allocation-explain>`_
@@ -870,9 +871,9 @@ async def put_settings(
870871
871872
:param flat_settings: Return settings in flat format (default: false)
872873
:param master_timeout: Explicit operation timeout for connection to master node
873-
:param persistent:
874+
:param persistent: The settings that persist after the cluster restarts.
874875
:param timeout: Explicit operation timeout
875-
:param transient:
876+
:param transient: The settings that do not persist after the cluster restarts.
876877
"""
877878
__path_parts: t.Dict[str, str] = {}
878879
__path = "/_cluster/settings"

elasticsearch/_async/client/esql.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class EsqlClient(NamespacedClient):
3131
"columnar",
3232
"filter",
3333
"include_ccs_metadata",
34+
"keep_alive",
35+
"keep_on_completion",
3436
"locale",
3537
"params",
3638
"profile",
@@ -145,10 +147,6 @@ async def async_query(
145147
__query["format"] = format
146148
if human is not None:
147149
__query["human"] = human
148-
if keep_alive is not None:
149-
__query["keep_alive"] = keep_alive
150-
if keep_on_completion is not None:
151-
__query["keep_on_completion"] = keep_on_completion
152150
if pretty is not None:
153151
__query["pretty"] = pretty
154152
if not __body:
@@ -160,6 +158,10 @@ async def async_query(
160158
__body["filter"] = filter
161159
if include_ccs_metadata is not None:
162160
__body["include_ccs_metadata"] = include_ccs_metadata
161+
if keep_alive is not None:
162+
__body["keep_alive"] = keep_alive
163+
if keep_on_completion is not None:
164+
__body["keep_on_completion"] = keep_on_completion
163165
if locale is not None:
164166
__body["locale"] = locale
165167
if params is not None:

elasticsearch/_async/client/indices.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3861,16 +3861,45 @@ async def put_settings(
38613861
Changes dynamic index settings in real time.
38623862
For data streams, index setting changes are applied to all backing indices by default.</p>
38633863
<p>To revert a setting to the default value, use a null value.
3864-
The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation.
3864+
The list of per-index settings that can be updated dynamically on live indices can be found in index settings documentation.
38653865
To preserve existing settings from being updated, set the <code>preserve_existing</code> parameter to <code>true</code>.</p>
3866+
<p>For performance optimization during bulk indexing, you can disable the refresh interval.
3867+
Refer to <a href="https://www.elastic.co/docs/deploy-manage/production-guidance/optimize-performance/indexing-speed#disable-refresh-interval">disable refresh interval</a> for an example.
3868+
There are multiple valid ways to represent index settings in the request body. You can specify only the setting, for example:</p>
3869+
<pre><code>{
3870+
&quot;number_of_replicas&quot;: 1
3871+
}
3872+
</code></pre>
3873+
<p>Or you can use an <code>index</code> setting object:</p>
3874+
<pre><code>{
3875+
&quot;index&quot;: {
3876+
&quot;number_of_replicas&quot;: 1
3877+
}
3878+
}
3879+
</code></pre>
3880+
<p>Or you can use dot annotation:</p>
3881+
<pre><code>{
3882+
&quot;index.number_of_replicas&quot;: 1
3883+
}
3884+
</code></pre>
3885+
<p>Or you can embed any of the aforementioned options in a <code>settings</code> object. For example:</p>
3886+
<pre><code>{
3887+
&quot;settings&quot;: {
3888+
&quot;index&quot;: {
3889+
&quot;number_of_replicas&quot;: 1
3890+
}
3891+
}
3892+
}
3893+
</code></pre>
38663894
<p>NOTE: You can only define new analyzers on closed indices.
38673895
To add an analyzer, you must close the index, define the analyzer, and reopen the index.
38683896
You cannot close the write index of a data stream.
38693897
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.
38703898
Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices.
38713899
This affects searches and any new data added to the stream after the rollover.
38723900
However, it does not affect the data stream's backing indices or their existing data.
3873-
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.</p>
3901+
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.
3902+
Refer to <a href="https://www.elastic.co/docs/manage-data/data-store/text-analysis/specify-an-analyzer#update-analyzers-on-existing-indices">updating analyzers on existing indices</a> for step-by-step examples.</p>
38743903
38753904
38763905
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-settings>`_

elasticsearch/_async/client/inference.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,33 @@ async def put(
374374
<p>IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face.
375375
For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models.
376376
However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.</p>
377+
<p>The following integrations are available through the inference API. You can find the available task types next to the integration name:</p>
378+
<ul>
379+
<li>AlibabaCloud AI Search (<code>completion</code>, <code>rerank</code>, <code>sparse_embedding</code>, <code>text_embedding</code>)</li>
380+
<li>Amazon Bedrock (<code>completion</code>, <code>text_embedding</code>)</li>
381+
<li>Anthropic (<code>completion</code>)</li>
382+
<li>Azure AI Studio (<code>completion</code>, <code>text_embedding</code>)</li>
383+
<li>Azure OpenAI (<code>completion</code>, <code>text_embedding</code>)</li>
384+
<li>Cohere (<code>completion</code>, <code>rerank</code>, <code>text_embedding</code>)</li>
385+
<li>Elasticsearch (<code>rerank</code>, <code>sparse_embedding</code>, <code>text_embedding</code> - this service is for built-in models and models uploaded through Eland)</li>
386+
<li>ELSER (<code>sparse_embedding</code>)</li>
387+
<li>Google AI Studio (<code>completion</code>, <code>text_embedding</code>)</li>
388+
<li>Google Vertex AI (<code>rerank</code>, <code>text_embedding</code>)</li>
389+
<li>Hugging Face (<code>text_embedding</code>)</li>
390+
<li>Mistral (<code>text_embedding</code>)</li>
391+
<li>OpenAI (<code>chat_completion</code>, <code>completion</code>, <code>text_embedding</code>)</li>
392+
<li>VoyageAI (<code>text_embedding</code>, <code>rerank</code>)</li>
393+
<li>Watsonx inference integration (<code>text_embedding</code>)</li>
394+
<li>JinaAI (<code>text_embedding</code>, <code>rerank</code>)</li>
395+
</ul>
377396
378397
379398
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-put>`_
380399
381400
:param inference_id: The inference Id
382401
:param inference_config:
383-
:param task_type: The task type
402+
:param task_type: The task type. Refer to the integration list in the API description
403+
for the available task types.
384404
"""
385405
if inference_id in SKIP_IN_PATH:
386406
raise ValueError("Empty value passed for parameter 'inference_id'")
@@ -543,7 +563,7 @@ async def put_amazonbedrock(
543563
.. raw:: html
544564
545565
<p>Create an Amazon Bedrock inference endpoint.</p>
546-
<p>Creates an inference endpoint to perform an inference task with the <code>amazonbedrock</code> service.</p>
566+
<p>Create an inference endpoint to perform an inference task with the <code>amazonbedrock</code> service.</p>
547567
<blockquote>
548568
<p>info
549569
You need to provide the access and secret keys only once, during the inference model creation. The get inference API does not retrieve your access or secret keys. After creating the inference model, you cannot change the associated key pairs. If you want to use a different access and secret key pair, delete the inference model and recreate it with the same name and the updated keys.</p>

elasticsearch/_async/client/ml.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3549,7 +3549,8 @@ async def put_datafeed(
35493549
Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
35503550
You can associate only one datafeed with each anomaly detection job.
35513551
The datafeed contains a query that runs at a defined interval (<code>frequency</code>).
3552-
If you are concerned about delayed data, you can add a delay (<code>query_delay') at each interval. By default, the datafeed uses the following query: </code>{&quot;match_all&quot;: {&quot;boost&quot;: 1}}`.</p>
3552+
If you are concerned about delayed data, you can add a delay (<code>query_delay</code>) at each interval.
3553+
By default, the datafeed uses the following query: <code>{&quot;match_all&quot;: {&quot;boost&quot;: 1}}</code>.</p>
35533554
<p>When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
35543555
at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
35553556
those credentials are used instead.

elasticsearch/_sync/client/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@ def bulk(
635635
Imagine a <code>_bulk?refresh=wait_for</code> request with three documents in it that happen to be routed to different shards in an index with five shards.
636636
The request will only wait for those three shards to refresh.
637637
The other two shards that make up the index do not participate in the <code>_bulk</code> request at all.</p>
638+
<p>You might want to disable the refresh interval temporarily to improve indexing throughput for large bulk requests.
639+
Refer to the linked documentation for step-by-step instructions using the index settings API.</p>
638640
639641
640642
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-bulk>`_
@@ -5865,7 +5867,8 @@ def termvectors(
58655867
The information is only retrieved for the shard the requested document resides in.
58665868
The term and field statistics are therefore only useful as relative measures whereas the absolute numbers have no meaning in this context.
58675869
By default, when requesting term vectors of artificial documents, a shard to get the statistics from is randomly selected.
5868-
Use <code>routing</code> only to hit a particular shard.</p>
5870+
Use <code>routing</code> only to hit a particular shard.
5871+
Refer to the linked documentation for detailed examples of how to use this API.</p>
58695872
58705873
58715874
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-termvectors>`_

elasticsearch/_sync/client/cluster.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def allocation_explain(
5151
Get explanations for shard allocations in the cluster.
5252
For unassigned shards, it provides an explanation for why the shard is unassigned.
5353
For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node.
54-
This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.</p>
54+
This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.
55+
Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API.</p>
5556
5657
5758
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cluster-allocation-explain>`_
@@ -870,9 +871,9 @@ def put_settings(
870871
871872
:param flat_settings: Return settings in flat format (default: false)
872873
:param master_timeout: Explicit operation timeout for connection to master node
873-
:param persistent:
874+
:param persistent: The settings that persist after the cluster restarts.
874875
:param timeout: Explicit operation timeout
875-
:param transient:
876+
:param transient: The settings that do not persist after the cluster restarts.
876877
"""
877878
__path_parts: t.Dict[str, str] = {}
878879
__path = "/_cluster/settings"

elasticsearch/_sync/client/esql.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class EsqlClient(NamespacedClient):
3131
"columnar",
3232
"filter",
3333
"include_ccs_metadata",
34+
"keep_alive",
35+
"keep_on_completion",
3436
"locale",
3537
"params",
3638
"profile",
@@ -145,10 +147,6 @@ def async_query(
145147
__query["format"] = format
146148
if human is not None:
147149
__query["human"] = human
148-
if keep_alive is not None:
149-
__query["keep_alive"] = keep_alive
150-
if keep_on_completion is not None:
151-
__query["keep_on_completion"] = keep_on_completion
152150
if pretty is not None:
153151
__query["pretty"] = pretty
154152
if not __body:
@@ -160,6 +158,10 @@ def async_query(
160158
__body["filter"] = filter
161159
if include_ccs_metadata is not None:
162160
__body["include_ccs_metadata"] = include_ccs_metadata
161+
if keep_alive is not None:
162+
__body["keep_alive"] = keep_alive
163+
if keep_on_completion is not None:
164+
__body["keep_on_completion"] = keep_on_completion
163165
if locale is not None:
164166
__body["locale"] = locale
165167
if params is not None:

elasticsearch/_sync/client/indices.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3861,16 +3861,45 @@ def put_settings(
38613861
Changes dynamic index settings in real time.
38623862
For data streams, index setting changes are applied to all backing indices by default.</p>
38633863
<p>To revert a setting to the default value, use a null value.
3864-
The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation.
3864+
The list of per-index settings that can be updated dynamically on live indices can be found in index settings documentation.
38653865
To preserve existing settings from being updated, set the <code>preserve_existing</code> parameter to <code>true</code>.</p>
3866+
<p>For performance optimization during bulk indexing, you can disable the refresh interval.
3867+
Refer to <a href="https://www.elastic.co/docs/deploy-manage/production-guidance/optimize-performance/indexing-speed#disable-refresh-interval">disable refresh interval</a> for an example.
3868+
There are multiple valid ways to represent index settings in the request body. You can specify only the setting, for example:</p>
3869+
<pre><code>{
3870+
&quot;number_of_replicas&quot;: 1
3871+
}
3872+
</code></pre>
3873+
<p>Or you can use an <code>index</code> setting object:</p>
3874+
<pre><code>{
3875+
&quot;index&quot;: {
3876+
&quot;number_of_replicas&quot;: 1
3877+
}
3878+
}
3879+
</code></pre>
3880+
<p>Or you can use dot annotation:</p>
3881+
<pre><code>{
3882+
&quot;index.number_of_replicas&quot;: 1
3883+
}
3884+
</code></pre>
3885+
<p>Or you can embed any of the aforementioned options in a <code>settings</code> object. For example:</p>
3886+
<pre><code>{
3887+
&quot;settings&quot;: {
3888+
&quot;index&quot;: {
3889+
&quot;number_of_replicas&quot;: 1
3890+
}
3891+
}
3892+
}
3893+
</code></pre>
38663894
<p>NOTE: You can only define new analyzers on closed indices.
38673895
To add an analyzer, you must close the index, define the analyzer, and reopen the index.
38683896
You cannot close the write index of a data stream.
38693897
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.
38703898
Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices.
38713899
This affects searches and any new data added to the stream after the rollover.
38723900
However, it does not affect the data stream's backing indices or their existing data.
3873-
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.</p>
3901+
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.
3902+
Refer to <a href="https://www.elastic.co/docs/manage-data/data-store/text-analysis/specify-an-analyzer#update-analyzers-on-existing-indices">updating analyzers on existing indices</a> for step-by-step examples.</p>
38743903
38753904
38763905
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-settings>`_

0 commit comments

Comments
 (0)