elasticsearch 8.14.0__py3-none-any.whl → 8.15.0__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/_async/client/__init__.py +196 -168
- elasticsearch/_async/client/async_search.py +35 -20
- elasticsearch/_async/client/autoscaling.py +4 -4
- elasticsearch/_async/client/cat.py +785 -180
- elasticsearch/_async/client/ccr.py +20 -32
- elasticsearch/_async/client/cluster.py +87 -79
- elasticsearch/_async/client/connector.py +1470 -0
- elasticsearch/_async/client/dangling_indices.py +7 -11
- elasticsearch/_async/client/enrich.py +8 -8
- elasticsearch/_async/client/eql.py +17 -16
- elasticsearch/_async/client/esql.py +2 -2
- elasticsearch/_async/client/features.py +2 -2
- elasticsearch/_async/client/fleet.py +18 -17
- elasticsearch/_async/client/graph.py +4 -4
- elasticsearch/_async/client/ilm.py +36 -44
- elasticsearch/_async/client/indices.py +282 -317
- elasticsearch/_async/client/inference.py +42 -33
- elasticsearch/_async/client/ingest.py +22 -23
- elasticsearch/_async/client/license.py +18 -10
- elasticsearch/_async/client/logstash.py +6 -6
- elasticsearch/_async/client/migration.py +3 -3
- elasticsearch/_async/client/ml.py +383 -176
- elasticsearch/_async/client/monitoring.py +2 -2
- elasticsearch/_async/client/nodes.py +32 -32
- elasticsearch/_async/client/query_rules.py +384 -0
- elasticsearch/_async/client/rollup.py +13 -13
- elasticsearch/_async/client/search_application.py +10 -10
- elasticsearch/_async/client/searchable_snapshots.py +9 -13
- elasticsearch/_async/client/security.py +577 -104
- elasticsearch/_async/client/shutdown.py +7 -7
- elasticsearch/_async/client/slm.py +11 -13
- elasticsearch/_async/client/snapshot.py +39 -52
- elasticsearch/_async/client/sql.py +12 -14
- elasticsearch/_async/client/ssl.py +1 -1
- elasticsearch/_async/client/synonyms.py +8 -8
- elasticsearch/_async/client/tasks.py +9 -10
- elasticsearch/_async/client/text_structure.py +3 -3
- elasticsearch/_async/client/transform.py +89 -34
- elasticsearch/_async/client/watcher.py +30 -15
- elasticsearch/_async/client/xpack.py +6 -7
- elasticsearch/_otel.py +2 -6
- elasticsearch/_sync/client/__init__.py +196 -168
- elasticsearch/_sync/client/async_search.py +35 -20
- elasticsearch/_sync/client/autoscaling.py +4 -4
- elasticsearch/_sync/client/cat.py +785 -180
- elasticsearch/_sync/client/ccr.py +20 -32
- elasticsearch/_sync/client/cluster.py +87 -79
- elasticsearch/_sync/client/connector.py +1470 -0
- elasticsearch/_sync/client/dangling_indices.py +7 -11
- elasticsearch/_sync/client/enrich.py +8 -8
- elasticsearch/_sync/client/eql.py +17 -16
- elasticsearch/_sync/client/esql.py +2 -2
- elasticsearch/_sync/client/features.py +2 -2
- elasticsearch/_sync/client/fleet.py +18 -17
- elasticsearch/_sync/client/graph.py +4 -4
- elasticsearch/_sync/client/ilm.py +36 -44
- elasticsearch/_sync/client/indices.py +282 -317
- elasticsearch/_sync/client/inference.py +42 -33
- elasticsearch/_sync/client/ingest.py +22 -23
- elasticsearch/_sync/client/license.py +18 -10
- elasticsearch/_sync/client/logstash.py +6 -6
- elasticsearch/_sync/client/migration.py +3 -3
- elasticsearch/_sync/client/ml.py +383 -176
- elasticsearch/_sync/client/monitoring.py +2 -2
- elasticsearch/_sync/client/nodes.py +32 -32
- elasticsearch/_sync/client/query_rules.py +384 -0
- elasticsearch/_sync/client/rollup.py +13 -13
- elasticsearch/_sync/client/search_application.py +10 -10
- elasticsearch/_sync/client/searchable_snapshots.py +9 -13
- elasticsearch/_sync/client/security.py +577 -104
- elasticsearch/_sync/client/shutdown.py +7 -7
- elasticsearch/_sync/client/slm.py +11 -13
- elasticsearch/_sync/client/snapshot.py +39 -52
- elasticsearch/_sync/client/sql.py +12 -14
- elasticsearch/_sync/client/ssl.py +1 -1
- elasticsearch/_sync/client/synonyms.py +8 -8
- elasticsearch/_sync/client/tasks.py +9 -10
- elasticsearch/_sync/client/text_structure.py +3 -3
- elasticsearch/_sync/client/transform.py +89 -34
- elasticsearch/_sync/client/watcher.py +30 -15
- elasticsearch/_sync/client/xpack.py +6 -7
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +3 -3
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +36 -6
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +36 -6
- elasticsearch/serializer.py +34 -0
- elasticsearch-8.15.0.dist-info/METADATA +177 -0
- elasticsearch-8.15.0.dist-info/RECORD +117 -0
- {elasticsearch-8.14.0.dist-info → elasticsearch-8.15.0.dist-info}/WHEEL +1 -2
- elasticsearch/_async/client/query_ruleset.py +0 -205
- elasticsearch/_sync/client/query_ruleset.py +0 -205
- elasticsearch-8.14.0.dist-info/METADATA +0 -161
- elasticsearch-8.14.0.dist-info/RECORD +0 -116
- elasticsearch-8.14.0.dist-info/top_level.txt +0 -1
- {elasticsearch-8.14.0.dist-info → elasticsearch-8.15.0.dist-info/licenses}/LICENSE +0 -0
- {elasticsearch-8.14.0.dist-info → elasticsearch-8.15.0.dist-info/licenses}/NOTICE +0 -0
|
@@ -36,12 +36,12 @@ class TransformClient(NamespacedClient):
|
|
|
36
36
|
force: t.Optional[bool] = None,
|
|
37
37
|
human: t.Optional[bool] = None,
|
|
38
38
|
pretty: t.Optional[bool] = None,
|
|
39
|
-
timeout: t.Optional[t.Union[
|
|
39
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
40
40
|
) -> ObjectApiResponse[t.Any]:
|
|
41
41
|
"""
|
|
42
|
-
Deletes
|
|
42
|
+
Deletes a transform.
|
|
43
43
|
|
|
44
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
44
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/delete-transform.html>`_
|
|
45
45
|
|
|
46
46
|
:param transform_id: Identifier for the transform.
|
|
47
47
|
:param delete_dest_index: If this value is true, the destination index is deleted
|
|
@@ -101,7 +101,7 @@ class TransformClient(NamespacedClient):
|
|
|
101
101
|
"""
|
|
102
102
|
Retrieves configuration information for transforms.
|
|
103
103
|
|
|
104
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
104
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/get-transform.html>`_
|
|
105
105
|
|
|
106
106
|
:param transform_id: Identifier for the transform. It can be a transform identifier
|
|
107
107
|
or a wildcard expression. You can get information for all transforms by using
|
|
@@ -165,12 +165,12 @@ class TransformClient(NamespacedClient):
|
|
|
165
165
|
human: t.Optional[bool] = None,
|
|
166
166
|
pretty: t.Optional[bool] = None,
|
|
167
167
|
size: t.Optional[int] = None,
|
|
168
|
-
timeout: t.Optional[t.Union[
|
|
168
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
169
169
|
) -> ObjectApiResponse[t.Any]:
|
|
170
170
|
"""
|
|
171
171
|
Retrieves usage information for transforms.
|
|
172
172
|
|
|
173
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
173
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/get-transform-stats.html>`_
|
|
174
174
|
|
|
175
175
|
:param transform_id: Identifier for the transform. It can be a transform identifier
|
|
176
176
|
or a wildcard expression. You can get information for all transforms by using
|
|
@@ -236,7 +236,7 @@ class TransformClient(NamespacedClient):
|
|
|
236
236
|
dest: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
237
237
|
error_trace: t.Optional[bool] = None,
|
|
238
238
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
239
|
-
frequency: t.Optional[t.Union[
|
|
239
|
+
frequency: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
240
240
|
human: t.Optional[bool] = None,
|
|
241
241
|
latest: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
242
242
|
pivot: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -245,13 +245,16 @@ class TransformClient(NamespacedClient):
|
|
|
245
245
|
settings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
246
246
|
source: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
247
247
|
sync: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
248
|
-
timeout: t.Optional[t.Union[
|
|
248
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
249
249
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
250
250
|
) -> ObjectApiResponse[t.Any]:
|
|
251
251
|
"""
|
|
252
|
-
Previews a transform.
|
|
252
|
+
Previews a transform. It returns a maximum of 100 results. The calculations are
|
|
253
|
+
based on all the current data in the source index. It also generates a list of
|
|
254
|
+
mappings and settings for the destination index. These values are determined
|
|
255
|
+
based on the field types of the source index and the transform aggregations.
|
|
253
256
|
|
|
254
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
257
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/preview-transform.html>`_
|
|
255
258
|
|
|
256
259
|
:param transform_id: Identifier for the transform to preview. If you specify
|
|
257
260
|
this path parameter, you cannot provide transform configuration details in
|
|
@@ -353,7 +356,7 @@ class TransformClient(NamespacedClient):
|
|
|
353
356
|
description: t.Optional[str] = None,
|
|
354
357
|
error_trace: t.Optional[bool] = None,
|
|
355
358
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
356
|
-
frequency: t.Optional[t.Union[
|
|
359
|
+
frequency: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
357
360
|
human: t.Optional[bool] = None,
|
|
358
361
|
latest: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
359
362
|
meta: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -362,13 +365,32 @@ class TransformClient(NamespacedClient):
|
|
|
362
365
|
retention_policy: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
363
366
|
settings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
364
367
|
sync: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
365
|
-
timeout: t.Optional[t.Union[
|
|
368
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
366
369
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
367
370
|
) -> ObjectApiResponse[t.Any]:
|
|
368
371
|
"""
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
+
Creates a transform. A transform copies data from source indices, transforms
|
|
373
|
+
it, and persists it into an entity-centric destination index. You can also think
|
|
374
|
+
of the destination index as a two-dimensional tabular data structure (known as
|
|
375
|
+
a data frame). The ID for each document in the data frame is generated from a
|
|
376
|
+
hash of the entity, so there is a unique row per entity. You must choose either
|
|
377
|
+
the latest or pivot method for your transform; you cannot use both in a single
|
|
378
|
+
transform. If you choose to use the pivot method for your transform, the entities
|
|
379
|
+
are defined by the set of `group_by` fields in the pivot object. If you choose
|
|
380
|
+
to use the latest method, the entities are defined by the `unique_key` field
|
|
381
|
+
values in the latest object. You must have `create_index`, `index`, and `read`
|
|
382
|
+
privileges on the destination index and `read` and `view_index_metadata` privileges
|
|
383
|
+
on the source indices. When Elasticsearch security features are enabled, the
|
|
384
|
+
transform remembers which roles the user that created it had at the time of creation
|
|
385
|
+
and uses those same roles. If those roles do not have the required privileges
|
|
386
|
+
on the source and destination indices, the transform fails when it attempts unauthorized
|
|
387
|
+
operations. NOTE: You must use Kibana or this API to create a transform. Do not
|
|
388
|
+
add a transform directly into any `.transform-internal*` indices using the Elasticsearch
|
|
389
|
+
index API. If Elasticsearch security features are enabled, do not give users
|
|
390
|
+
any privileges on `.transform-internal*` indices. If you used transforms prior
|
|
391
|
+
to 7.5, also do not give users any privileges on `.data-frame-internal*` indices.
|
|
392
|
+
|
|
393
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/put-transform.html>`_
|
|
372
394
|
|
|
373
395
|
:param transform_id: Identifier for the transform. This identifier can contain
|
|
374
396
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -466,9 +488,11 @@ class TransformClient(NamespacedClient):
|
|
|
466
488
|
pretty: t.Optional[bool] = None,
|
|
467
489
|
) -> ObjectApiResponse[t.Any]:
|
|
468
490
|
"""
|
|
469
|
-
Resets
|
|
491
|
+
Resets a transform. Before you can reset it, you must stop it; alternatively,
|
|
492
|
+
use the `force` query parameter. If the destination index was created by the
|
|
493
|
+
transform, it is deleted.
|
|
470
494
|
|
|
471
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
495
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/reset-transform.html>`_
|
|
472
496
|
|
|
473
497
|
:param transform_id: Identifier for the transform. This identifier can contain
|
|
474
498
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -511,12 +535,15 @@ class TransformClient(NamespacedClient):
|
|
|
511
535
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
512
536
|
human: t.Optional[bool] = None,
|
|
513
537
|
pretty: t.Optional[bool] = None,
|
|
514
|
-
timeout: t.Optional[t.Union[
|
|
538
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
515
539
|
) -> ObjectApiResponse[t.Any]:
|
|
516
540
|
"""
|
|
517
|
-
Schedules now a transform.
|
|
541
|
+
Schedules now a transform. If you _schedule_now a transform, it will process
|
|
542
|
+
the new data instantly, without waiting for the configured frequency interval.
|
|
543
|
+
After _schedule_now API is called, the transform will be processed again at now
|
|
544
|
+
+ frequency unless _schedule_now API is called again in the meantime.
|
|
518
545
|
|
|
519
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
546
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/schedule-now-transform.html>`_
|
|
520
547
|
|
|
521
548
|
:param transform_id: Identifier for the transform.
|
|
522
549
|
:param timeout: Controls the time to wait for the scheduling to take place
|
|
@@ -558,12 +585,28 @@ class TransformClient(NamespacedClient):
|
|
|
558
585
|
from_: t.Optional[str] = None,
|
|
559
586
|
human: t.Optional[bool] = None,
|
|
560
587
|
pretty: t.Optional[bool] = None,
|
|
561
|
-
timeout: t.Optional[t.Union[
|
|
588
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
562
589
|
) -> ObjectApiResponse[t.Any]:
|
|
563
590
|
"""
|
|
564
|
-
Starts
|
|
565
|
-
|
|
566
|
-
|
|
591
|
+
Starts a transform. When you start a transform, it creates the destination index
|
|
592
|
+
if it does not already exist. The `number_of_shards` is set to `1` and the `auto_expand_replicas`
|
|
593
|
+
is set to `0-1`. If it is a pivot transform, it deduces the mapping definitions
|
|
594
|
+
for the destination index from the source indices and the transform aggregations.
|
|
595
|
+
If fields in the destination index are derived from scripts (as in the case of
|
|
596
|
+
`scripted_metric` or `bucket_script` aggregations), the transform uses dynamic
|
|
597
|
+
mappings unless an index template exists. If it is a latest transform, it does
|
|
598
|
+
not deduce mapping definitions; it uses dynamic mappings. To use explicit mappings,
|
|
599
|
+
create the destination index before you start the transform. Alternatively, you
|
|
600
|
+
can create an index template, though it does not affect the deduced mappings
|
|
601
|
+
in a pivot transform. When the transform starts, a series of validations occur
|
|
602
|
+
to ensure its success. If you deferred validation when you created the transform,
|
|
603
|
+
they occur when you start the transform—with the exception of privilege checks.
|
|
604
|
+
When Elasticsearch security features are enabled, the transform remembers which
|
|
605
|
+
roles the user that created it had at the time of creation and uses those same
|
|
606
|
+
roles. If those roles do not have the required privileges on the source and destination
|
|
607
|
+
indices, the transform fails when it attempts unauthorized operations.
|
|
608
|
+
|
|
609
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/start-transform.html>`_
|
|
567
610
|
|
|
568
611
|
:param transform_id: Identifier for the transform.
|
|
569
612
|
:param from_: Restricts the set of transformed entities to those changed after
|
|
@@ -610,14 +653,14 @@ class TransformClient(NamespacedClient):
|
|
|
610
653
|
force: t.Optional[bool] = None,
|
|
611
654
|
human: t.Optional[bool] = None,
|
|
612
655
|
pretty: t.Optional[bool] = None,
|
|
613
|
-
timeout: t.Optional[t.Union[
|
|
656
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
614
657
|
wait_for_checkpoint: t.Optional[bool] = None,
|
|
615
658
|
wait_for_completion: t.Optional[bool] = None,
|
|
616
659
|
) -> ObjectApiResponse[t.Any]:
|
|
617
660
|
"""
|
|
618
661
|
Stops one or more transforms.
|
|
619
662
|
|
|
620
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
663
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/stop-transform.html>`_
|
|
621
664
|
|
|
622
665
|
:param transform_id: Identifier for the transform. To stop multiple transforms,
|
|
623
666
|
use a comma-separated list or a wildcard expression. To stop all transforms,
|
|
@@ -696,7 +739,7 @@ class TransformClient(NamespacedClient):
|
|
|
696
739
|
dest: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
697
740
|
error_trace: t.Optional[bool] = None,
|
|
698
741
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
699
|
-
frequency: t.Optional[t.Union[
|
|
742
|
+
frequency: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
700
743
|
human: t.Optional[bool] = None,
|
|
701
744
|
meta: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
702
745
|
pretty: t.Optional[bool] = None,
|
|
@@ -704,13 +747,19 @@ class TransformClient(NamespacedClient):
|
|
|
704
747
|
settings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
705
748
|
source: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
706
749
|
sync: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
707
|
-
timeout: t.Optional[t.Union[
|
|
750
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
708
751
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
709
752
|
) -> ObjectApiResponse[t.Any]:
|
|
710
753
|
"""
|
|
711
|
-
Updates certain properties of a transform.
|
|
754
|
+
Updates certain properties of a transform. All updated properties except `description`
|
|
755
|
+
do not take effect until after the transform starts the next checkpoint, thus
|
|
756
|
+
there is data consistency in each checkpoint. To use this API, you must have
|
|
757
|
+
`read` and `view_index_metadata` privileges for the source indices. You must
|
|
758
|
+
also have `index` and `read` privileges for the destination index. When Elasticsearch
|
|
759
|
+
security features are enabled, the transform remembers which roles the user who
|
|
760
|
+
updated it had at the time of update and runs with those privileges.
|
|
712
761
|
|
|
713
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
762
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/update-transform.html>`_
|
|
714
763
|
|
|
715
764
|
:param transform_id: Identifier for the transform.
|
|
716
765
|
:param defer_validation: When true, deferrable validations are not run. This
|
|
@@ -786,12 +835,18 @@ class TransformClient(NamespacedClient):
|
|
|
786
835
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
787
836
|
human: t.Optional[bool] = None,
|
|
788
837
|
pretty: t.Optional[bool] = None,
|
|
789
|
-
timeout: t.Optional[t.Union[
|
|
838
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
790
839
|
) -> ObjectApiResponse[t.Any]:
|
|
791
840
|
"""
|
|
792
|
-
Upgrades all transforms.
|
|
793
|
-
|
|
794
|
-
|
|
841
|
+
Upgrades all transforms. This API identifies transforms that have a legacy configuration
|
|
842
|
+
format and upgrades them to the latest version. It also cleans up the internal
|
|
843
|
+
data structures that store the transform state and checkpoints. The upgrade does
|
|
844
|
+
not affect the source and destination indices. The upgrade also does not affect
|
|
845
|
+
the roles that transforms use when Elasticsearch security features are enabled;
|
|
846
|
+
the role used to read source data and write to the destination index remains
|
|
847
|
+
unchanged.
|
|
848
|
+
|
|
849
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/upgrade-transforms.html>`_
|
|
795
850
|
|
|
796
851
|
:param dry_run: When true, the request checks for updates but does not run them.
|
|
797
852
|
:param timeout: Period to wait for a response. If no response is received before
|
|
@@ -39,7 +39,7 @@ class WatcherClient(NamespacedClient):
|
|
|
39
39
|
"""
|
|
40
40
|
Acknowledges a watch, manually throttling the execution of the watch's actions.
|
|
41
41
|
|
|
42
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
42
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-ack-watch.html>`_
|
|
43
43
|
|
|
44
44
|
:param watch_id: Watch ID
|
|
45
45
|
:param action_id: A comma-separated list of the action ids to be acked
|
|
@@ -90,7 +90,7 @@ class WatcherClient(NamespacedClient):
|
|
|
90
90
|
"""
|
|
91
91
|
Activates a currently inactive watch.
|
|
92
92
|
|
|
93
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
93
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-activate-watch.html>`_
|
|
94
94
|
|
|
95
95
|
:param watch_id: Watch ID
|
|
96
96
|
"""
|
|
@@ -130,7 +130,7 @@ class WatcherClient(NamespacedClient):
|
|
|
130
130
|
"""
|
|
131
131
|
Deactivates a currently active watch.
|
|
132
132
|
|
|
133
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
133
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-deactivate-watch.html>`_
|
|
134
134
|
|
|
135
135
|
:param watch_id: Watch ID
|
|
136
136
|
"""
|
|
@@ -170,7 +170,7 @@ class WatcherClient(NamespacedClient):
|
|
|
170
170
|
"""
|
|
171
171
|
Removes a watch from Watcher.
|
|
172
172
|
|
|
173
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
173
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-delete-watch.html>`_
|
|
174
174
|
|
|
175
175
|
:param id: Watch ID
|
|
176
176
|
"""
|
|
@@ -216,8 +216,10 @@ class WatcherClient(NamespacedClient):
|
|
|
216
216
|
t.Mapping[
|
|
217
217
|
str,
|
|
218
218
|
t.Union[
|
|
219
|
-
"t.Literal['execute', 'force_execute', 'force_simulate', 'simulate', 'skip']",
|
|
220
219
|
str,
|
|
220
|
+
t.Literal[
|
|
221
|
+
"execute", "force_execute", "force_simulate", "simulate", "skip"
|
|
222
|
+
],
|
|
221
223
|
],
|
|
222
224
|
]
|
|
223
225
|
] = None,
|
|
@@ -235,9 +237,15 @@ class WatcherClient(NamespacedClient):
|
|
|
235
237
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
236
238
|
) -> ObjectApiResponse[t.Any]:
|
|
237
239
|
"""
|
|
238
|
-
|
|
240
|
+
This API can be used to force execution of the watch outside of its triggering
|
|
241
|
+
logic or to simulate the watch execution for debugging purposes. For testing
|
|
242
|
+
and debugging purposes, you also have fine-grained control on how the watch runs.
|
|
243
|
+
You can execute the watch without executing all of its actions or alternatively
|
|
244
|
+
by simulating them. You can also force execution by ignoring the watch condition
|
|
245
|
+
and control whether a watch record would be written to the watch history after
|
|
246
|
+
execution.
|
|
239
247
|
|
|
240
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
248
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-execute-watch.html>`_
|
|
241
249
|
|
|
242
250
|
:param id: Identifier for the watch.
|
|
243
251
|
:param action_modes: Determines how to handle the watch actions as part of the
|
|
@@ -320,7 +328,7 @@ class WatcherClient(NamespacedClient):
|
|
|
320
328
|
"""
|
|
321
329
|
Retrieves a watch by its ID.
|
|
322
330
|
|
|
323
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
331
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-get-watch.html>`_
|
|
324
332
|
|
|
325
333
|
:param id: Watch ID
|
|
326
334
|
"""
|
|
@@ -382,7 +390,7 @@ class WatcherClient(NamespacedClient):
|
|
|
382
390
|
"""
|
|
383
391
|
Creates a new watch, or updates an existing one.
|
|
384
392
|
|
|
385
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
393
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-put-watch.html>`_
|
|
386
394
|
|
|
387
395
|
:param id: Watch ID
|
|
388
396
|
:param actions:
|
|
@@ -479,7 +487,7 @@ class WatcherClient(NamespacedClient):
|
|
|
479
487
|
"""
|
|
480
488
|
Retrieves stored watches.
|
|
481
489
|
|
|
482
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
490
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-query-watches.html>`_
|
|
483
491
|
|
|
484
492
|
:param from_: The offset from the first result to fetch. Needs to be non-negative.
|
|
485
493
|
:param query: Optional, query filter watches to be returned.
|
|
@@ -549,7 +557,7 @@ class WatcherClient(NamespacedClient):
|
|
|
549
557
|
"""
|
|
550
558
|
Starts Watcher if it is not already running.
|
|
551
559
|
|
|
552
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
560
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-start.html>`_
|
|
553
561
|
"""
|
|
554
562
|
__path_parts: t.Dict[str, str] = {}
|
|
555
563
|
__path = "/_watcher/_start"
|
|
@@ -580,13 +588,20 @@ class WatcherClient(NamespacedClient):
|
|
|
580
588
|
t.Union[
|
|
581
589
|
t.Sequence[
|
|
582
590
|
t.Union[
|
|
583
|
-
"t.Literal['_all', 'current_watches', 'pending_watches', 'queued_watches']",
|
|
584
591
|
str,
|
|
592
|
+
t.Literal[
|
|
593
|
+
"_all",
|
|
594
|
+
"current_watches",
|
|
595
|
+
"pending_watches",
|
|
596
|
+
"queued_watches",
|
|
597
|
+
],
|
|
585
598
|
]
|
|
586
599
|
],
|
|
587
600
|
t.Union[
|
|
588
|
-
"t.Literal['_all', 'current_watches', 'pending_watches', 'queued_watches']",
|
|
589
601
|
str,
|
|
602
|
+
t.Literal[
|
|
603
|
+
"_all", "current_watches", "pending_watches", "queued_watches"
|
|
604
|
+
],
|
|
590
605
|
],
|
|
591
606
|
]
|
|
592
607
|
] = None,
|
|
@@ -599,7 +614,7 @@ class WatcherClient(NamespacedClient):
|
|
|
599
614
|
"""
|
|
600
615
|
Retrieves the current Watcher metrics.
|
|
601
616
|
|
|
602
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
617
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-stats.html>`_
|
|
603
618
|
|
|
604
619
|
:param metric: Defines which additional metrics are included in the response.
|
|
605
620
|
:param emit_stacktraces: Defines whether stack traces are generated for each
|
|
@@ -645,7 +660,7 @@ class WatcherClient(NamespacedClient):
|
|
|
645
660
|
"""
|
|
646
661
|
Stops Watcher if it is running.
|
|
647
662
|
|
|
648
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
663
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/watcher-api-stop.html>`_
|
|
649
664
|
"""
|
|
650
665
|
__path_parts: t.Dict[str, str] = {}
|
|
651
666
|
__path = "/_watcher/_stop"
|
|
@@ -41,9 +41,9 @@ class XPackClient(NamespacedClient):
|
|
|
41
41
|
pretty: t.Optional[bool] = None,
|
|
42
42
|
) -> ObjectApiResponse[t.Any]:
|
|
43
43
|
"""
|
|
44
|
-
|
|
44
|
+
Provides general information about the installed X-Pack features.
|
|
45
45
|
|
|
46
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
46
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/info-api.html>`_
|
|
47
47
|
|
|
48
48
|
:param accept_enterprise: If this param is used it must be set to true
|
|
49
49
|
:param categories: A comma-separated list of the information categories to include
|
|
@@ -81,15 +81,14 @@ class XPackClient(NamespacedClient):
|
|
|
81
81
|
error_trace: t.Optional[bool] = None,
|
|
82
82
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
83
83
|
human: t.Optional[bool] = None,
|
|
84
|
-
master_timeout: t.Optional[
|
|
85
|
-
t.Union["t.Literal[-1]", "t.Literal[0]", str]
|
|
86
|
-
] = None,
|
|
84
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
87
85
|
pretty: t.Optional[bool] = None,
|
|
88
86
|
) -> ObjectApiResponse[t.Any]:
|
|
89
87
|
"""
|
|
90
|
-
|
|
88
|
+
This API provides information about which features are currently enabled and
|
|
89
|
+
available under the current license and some usage statistics.
|
|
91
90
|
|
|
92
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
91
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/usage-api.html>`_
|
|
93
92
|
|
|
94
93
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
95
94
|
no response is received before the timeout expires, the request fails and
|
elasticsearch/_version.py
CHANGED
elasticsearch/client.py
CHANGED
|
@@ -27,6 +27,7 @@ from ._sync.client.autoscaling import ( # noqa: F401
|
|
|
27
27
|
from ._sync.client.cat import CatClient as CatClient # noqa: F401
|
|
28
28
|
from ._sync.client.ccr import CcrClient as CcrClient # noqa: F401
|
|
29
29
|
from ._sync.client.cluster import ClusterClient as ClusterClient # noqa: F401
|
|
30
|
+
from ._sync.client.connector import ConnectorClient as ConnectorClient # noqa: F401
|
|
30
31
|
from ._sync.client.dangling_indices import ( # noqa: F401
|
|
31
32
|
DanglingIndicesClient as DanglingIndicesClient,
|
|
32
33
|
)
|
|
@@ -46,9 +47,7 @@ from ._sync.client.migration import MigrationClient as MigrationClient # noqa:
|
|
|
46
47
|
from ._sync.client.ml import MlClient as MlClient # noqa: F401
|
|
47
48
|
from ._sync.client.monitoring import MonitoringClient as MonitoringClient # noqa: F401
|
|
48
49
|
from ._sync.client.nodes import NodesClient as NodesClient # noqa: F401
|
|
49
|
-
from ._sync.client.
|
|
50
|
-
QueryRulesetClient as QueryRulesetClient,
|
|
51
|
-
)
|
|
50
|
+
from ._sync.client.query_rules import QueryRulesClient as QueryRulesClient # noqa: F401
|
|
52
51
|
from ._sync.client.rollup import RollupClient as RollupClient # noqa: F401
|
|
53
52
|
from ._sync.client.search_application import ( # noqa: F401
|
|
54
53
|
SearchApplicationClient as SearchApplicationClient,
|
|
@@ -86,6 +85,7 @@ __all__ = [
|
|
|
86
85
|
"CatClient",
|
|
87
86
|
"CcrClient",
|
|
88
87
|
"ClusterClient",
|
|
88
|
+
"ConnectorClient",
|
|
89
89
|
"DanglingIndicesClient",
|
|
90
90
|
"Elasticsearch",
|
|
91
91
|
"EnrichClient",
|
|
@@ -60,6 +60,7 @@ class AsyncVectorStore:
|
|
|
60
60
|
vector_field: str = "vector_field",
|
|
61
61
|
metadata_mappings: Optional[Dict[str, Any]] = None,
|
|
62
62
|
user_agent: str = f"elasticsearch-py-vs/{lib_version}",
|
|
63
|
+
custom_index_settings: Optional[Dict[str, Any]] = None,
|
|
63
64
|
) -> None:
|
|
64
65
|
"""
|
|
65
66
|
:param user_header: user agent header specific to the 3rd party integration.
|
|
@@ -72,6 +73,11 @@ class AsyncVectorStore:
|
|
|
72
73
|
the embedding vector goes in this field.
|
|
73
74
|
:param client: Elasticsearch client connection. Alternatively specify the
|
|
74
75
|
Elasticsearch connection with the other es_* parameters.
|
|
76
|
+
:param custom_index_settings: A dictionary of custom settings for the index.
|
|
77
|
+
This can include configurations like the number of shards, number of replicas,
|
|
78
|
+
analysis settings, and other index-specific settings. If not provided, default
|
|
79
|
+
settings will be used. Note that if the same setting is provided by both the user
|
|
80
|
+
and the strategy, will raise an error.
|
|
75
81
|
"""
|
|
76
82
|
# Add integration-specific usage header for tracking usage in Elastic Cloud.
|
|
77
83
|
# client.options preserves existing (non-user-agent) headers.
|
|
@@ -90,6 +96,7 @@ class AsyncVectorStore:
|
|
|
90
96
|
self.text_field = text_field
|
|
91
97
|
self.vector_field = vector_field
|
|
92
98
|
self.metadata_mappings = metadata_mappings
|
|
99
|
+
self.custom_index_settings = custom_index_settings
|
|
93
100
|
|
|
94
101
|
async def close(self) -> None:
|
|
95
102
|
return await self.client.close()
|
|
@@ -225,7 +232,7 @@ class AsyncVectorStore:
|
|
|
225
232
|
async def search(
|
|
226
233
|
self,
|
|
227
234
|
*,
|
|
228
|
-
query: Optional[str],
|
|
235
|
+
query: Optional[str] = None,
|
|
229
236
|
query_vector: Optional[List[float]] = None,
|
|
230
237
|
k: int = 4,
|
|
231
238
|
num_candidates: int = 50,
|
|
@@ -306,6 +313,16 @@ class AsyncVectorStore:
|
|
|
306
313
|
vector_field=self.vector_field,
|
|
307
314
|
num_dimensions=self.num_dimensions,
|
|
308
315
|
)
|
|
316
|
+
|
|
317
|
+
if self.custom_index_settings:
|
|
318
|
+
conflicting_keys = set(self.custom_index_settings.keys()) & set(
|
|
319
|
+
settings.keys()
|
|
320
|
+
)
|
|
321
|
+
if conflicting_keys:
|
|
322
|
+
raise ValueError(f"Conflicting settings: {conflicting_keys}")
|
|
323
|
+
else:
|
|
324
|
+
settings.update(self.custom_index_settings)
|
|
325
|
+
|
|
309
326
|
if self.metadata_mappings:
|
|
310
327
|
metadata = mappings["properties"].get("metadata", {"properties": {}})
|
|
311
328
|
for key in self.metadata_mappings.keys():
|
|
@@ -327,8 +344,9 @@ class AsyncVectorStore:
|
|
|
327
344
|
async def max_marginal_relevance_search(
|
|
328
345
|
self,
|
|
329
346
|
*,
|
|
330
|
-
|
|
331
|
-
|
|
347
|
+
query: Optional[str] = None,
|
|
348
|
+
query_embedding: Optional[List[float]] = None,
|
|
349
|
+
embedding_service: Optional[AsyncEmbeddingService] = None,
|
|
332
350
|
vector_field: str,
|
|
333
351
|
k: int = 4,
|
|
334
352
|
num_candidates: int = 20,
|
|
@@ -344,6 +362,8 @@ class AsyncVectorStore:
|
|
|
344
362
|
among selected documents.
|
|
345
363
|
|
|
346
364
|
:param query (str): Text to look up documents similar to.
|
|
365
|
+
:param query_embedding: Input embedding vector. If given, input query string is
|
|
366
|
+
ignored.
|
|
347
367
|
:param k (int): Number of Documents to return. Defaults to 4.
|
|
348
368
|
:param fetch_k (int): Number of Documents to fetch to pass to MMR algorithm.
|
|
349
369
|
:param lambda_mult (float): Number between 0 and 1 that determines the degree
|
|
@@ -364,12 +384,22 @@ class AsyncVectorStore:
|
|
|
364
384
|
remove_vector_query_field_from_metadata = False
|
|
365
385
|
|
|
366
386
|
# Embed the query
|
|
367
|
-
query_embedding
|
|
387
|
+
if query_embedding:
|
|
388
|
+
query_vector = query_embedding
|
|
389
|
+
else:
|
|
390
|
+
if not query:
|
|
391
|
+
raise ValueError("specify either query or query_embedding to search")
|
|
392
|
+
elif embedding_service:
|
|
393
|
+
query_vector = await embedding_service.embed_query(query)
|
|
394
|
+
elif self.embedding_service:
|
|
395
|
+
query_vector = await self.embedding_service.embed_query(query)
|
|
396
|
+
else:
|
|
397
|
+
raise ValueError("specify embedding_service to search with query")
|
|
368
398
|
|
|
369
399
|
# Fetch the initial documents
|
|
370
400
|
got_hits = await self.search(
|
|
371
401
|
query=None,
|
|
372
|
-
query_vector=
|
|
402
|
+
query_vector=query_vector,
|
|
373
403
|
k=num_candidates,
|
|
374
404
|
fields=fields,
|
|
375
405
|
custom_query=custom_query,
|
|
@@ -380,7 +410,7 @@ class AsyncVectorStore:
|
|
|
380
410
|
|
|
381
411
|
# Select documents using maximal marginal relevance
|
|
382
412
|
selected_indices = maximal_marginal_relevance(
|
|
383
|
-
|
|
413
|
+
query_vector, got_embeddings, lambda_mult=lambda_mult, k=k
|
|
384
414
|
)
|
|
385
415
|
selected_hits = [got_hits[i] for i in selected_indices]
|
|
386
416
|
|