elasticsearch 8.17.0__py3-none-any.whl → 8.17.1__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 +153 -51
- elasticsearch/_async/client/cat.py +64 -195
- elasticsearch/_async/client/cluster.py +19 -19
- elasticsearch/_async/client/connector.py +337 -0
- elasticsearch/_async/client/dangling_indices.py +3 -3
- elasticsearch/_async/client/ilm.py +6 -6
- elasticsearch/_async/client/indices.py +360 -81
- elasticsearch/_async/client/inference.py +94 -1
- elasticsearch/_async/client/ingest.py +175 -2
- elasticsearch/_async/client/logstash.py +9 -6
- elasticsearch/_async/client/migration.py +16 -7
- elasticsearch/_async/client/ml.py +12 -6
- elasticsearch/_async/client/monitoring.py +2 -1
- elasticsearch/_async/client/nodes.py +3 -3
- elasticsearch/_async/client/query_rules.py +33 -12
- elasticsearch/_async/client/rollup.py +88 -13
- elasticsearch/_async/client/search_application.py +130 -1
- elasticsearch/_async/client/searchable_snapshots.py +32 -23
- elasticsearch/_async/client/security.py +676 -55
- elasticsearch/_async/client/shutdown.py +38 -15
- elasticsearch/_async/client/simulate.py +151 -0
- elasticsearch/_async/client/slm.py +138 -19
- elasticsearch/_async/client/snapshot.py +307 -23
- elasticsearch/_async/client/sql.py +66 -46
- elasticsearch/_async/client/synonyms.py +39 -19
- elasticsearch/_async/client/tasks.py +68 -28
- elasticsearch/_async/client/text_structure.py +466 -46
- elasticsearch/_async/client/transform.py +9 -2
- elasticsearch/_async/client/watcher.py +207 -41
- elasticsearch/_async/client/xpack.py +11 -6
- elasticsearch/_sync/client/__init__.py +153 -51
- elasticsearch/_sync/client/cat.py +64 -195
- elasticsearch/_sync/client/cluster.py +19 -19
- elasticsearch/_sync/client/connector.py +337 -0
- elasticsearch/_sync/client/dangling_indices.py +3 -3
- elasticsearch/_sync/client/ilm.py +6 -6
- elasticsearch/_sync/client/indices.py +360 -81
- elasticsearch/_sync/client/inference.py +94 -1
- elasticsearch/_sync/client/ingest.py +175 -2
- elasticsearch/_sync/client/logstash.py +9 -6
- elasticsearch/_sync/client/migration.py +16 -7
- elasticsearch/_sync/client/ml.py +12 -6
- elasticsearch/_sync/client/monitoring.py +2 -1
- elasticsearch/_sync/client/nodes.py +3 -3
- elasticsearch/_sync/client/query_rules.py +33 -12
- elasticsearch/_sync/client/rollup.py +88 -13
- elasticsearch/_sync/client/search_application.py +130 -1
- elasticsearch/_sync/client/searchable_snapshots.py +32 -23
- elasticsearch/_sync/client/security.py +676 -55
- elasticsearch/_sync/client/shutdown.py +38 -15
- elasticsearch/_sync/client/simulate.py +151 -0
- elasticsearch/_sync/client/slm.py +138 -19
- elasticsearch/_sync/client/snapshot.py +307 -23
- elasticsearch/_sync/client/sql.py +66 -46
- elasticsearch/_sync/client/synonyms.py +39 -19
- elasticsearch/_sync/client/tasks.py +68 -28
- elasticsearch/_sync/client/text_structure.py +466 -46
- elasticsearch/_sync/client/transform.py +9 -2
- elasticsearch/_sync/client/watcher.py +207 -41
- elasticsearch/_sync/client/xpack.py +11 -6
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +2 -0
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/METADATA +1 -1
- elasticsearch-8.17.1.dist-info/RECORD +119 -0
- elasticsearch-8.17.0.dist-info/RECORD +0 -117
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/NOTICE +0 -0
|
@@ -70,6 +70,7 @@ from .search_application import SearchApplicationClient
|
|
|
70
70
|
from .searchable_snapshots import SearchableSnapshotsClient
|
|
71
71
|
from .security import SecurityClient
|
|
72
72
|
from .shutdown import ShutdownClient
|
|
73
|
+
from .simulate import SimulateClient
|
|
73
74
|
from .slm import SlmClient
|
|
74
75
|
from .snapshot import SnapshotClient
|
|
75
76
|
from .sql import SqlClient
|
|
@@ -465,6 +466,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
465
466
|
self.searchable_snapshots = SearchableSnapshotsClient(self)
|
|
466
467
|
self.security = SecurityClient(self)
|
|
467
468
|
self.slm = SlmClient(self)
|
|
469
|
+
self.simulate = SimulateClient(self)
|
|
468
470
|
self.shutdown = ShutdownClient(self)
|
|
469
471
|
self.sql = SqlClient(self)
|
|
470
472
|
self.ssl = SslClient(self)
|
|
@@ -644,41 +646,125 @@ class AsyncElasticsearch(BaseClient):
|
|
|
644
646
|
] = None,
|
|
645
647
|
) -> ObjectApiResponse[t.Any]:
|
|
646
648
|
"""
|
|
647
|
-
Bulk index or delete documents.
|
|
648
|
-
in a single
|
|
649
|
-
speed.
|
|
649
|
+
Bulk index or delete documents. Perform multiple `index`, `create`, `delete`,
|
|
650
|
+
and `update` actions in a single request. This reduces overhead and can greatly
|
|
651
|
+
increase indexing speed. If the Elasticsearch security features are enabled,
|
|
652
|
+
you must have the following index privileges for the target data stream, index,
|
|
653
|
+
or index alias: * To use the `create` action, you must have the `create_doc`,
|
|
654
|
+
`create`, `index`, or `write` index privilege. Data streams support only the
|
|
655
|
+
`create` action. * To use the `index` action, you must have the `create`, `index`,
|
|
656
|
+
or `write` index privilege. * To use the `delete` action, you must have the `delete`
|
|
657
|
+
or `write` index privilege. * To use the `update` action, you must have the `index`
|
|
658
|
+
or `write` index privilege. * To automatically create a data stream or index
|
|
659
|
+
with a bulk API request, you must have the `auto_configure`, `create_index`,
|
|
660
|
+
or `manage` index privilege. * To make the result of a bulk operation visible
|
|
661
|
+
to search using the `refresh` parameter, you must have the `maintenance` or `manage`
|
|
662
|
+
index privilege. Automatic data stream creation requires a matching index template
|
|
663
|
+
with data stream enabled. The actions are specified in the request body using
|
|
664
|
+
a newline delimited JSON (NDJSON) structure: ``` action_and_meta_data\\n optional_source\\n
|
|
665
|
+
action_and_meta_data\\n optional_source\\n .... action_and_meta_data\\n optional_source\\n
|
|
666
|
+
``` The `index` and `create` actions expect a source on the next line and have
|
|
667
|
+
the same semantics as the `op_type` parameter in the standard index API. A `create`
|
|
668
|
+
action fails if a document with the same ID already exists in the target An `index`
|
|
669
|
+
action adds or replaces a document as necessary. NOTE: Data streams support only
|
|
670
|
+
the `create` action. To update or delete a document in a data stream, you must
|
|
671
|
+
target the backing index containing the document. An `update` action expects
|
|
672
|
+
that the partial doc, upsert, and script and its options are specified on the
|
|
673
|
+
next line. A `delete` action does not expect a source on the next line and has
|
|
674
|
+
the same semantics as the standard delete API. NOTE: The final line of data must
|
|
675
|
+
end with a newline character (`\\n`). Each newline character may be preceded
|
|
676
|
+
by a carriage return (`\\r`). When sending NDJSON data to the `_bulk` endpoint,
|
|
677
|
+
use a `Content-Type` header of `application/json` or `application/x-ndjson`.
|
|
678
|
+
Because this format uses literal newline characters (`\\n`) as delimiters, make
|
|
679
|
+
sure that the JSON actions and sources are not pretty printed. If you provide
|
|
680
|
+
a target in the request path, it is used for any actions that don't explicitly
|
|
681
|
+
specify an `_index` argument. A note on the format: the idea here is to make
|
|
682
|
+
processing as fast as possible. As some of the actions are redirected to other
|
|
683
|
+
shards on other nodes, only `action_meta_data` is parsed on the receiving node
|
|
684
|
+
side. Client libraries using this protocol should try and strive to do something
|
|
685
|
+
similar on the client side, and reduce buffering as much as possible. There is
|
|
686
|
+
no "correct" number of actions to perform in a single bulk request. Experiment
|
|
687
|
+
with different settings to find the optimal size for your particular workload.
|
|
688
|
+
Note that Elasticsearch limits the maximum size of a HTTP request to 100mb by
|
|
689
|
+
default so clients must ensure that no request exceeds this size. It is not possible
|
|
690
|
+
to index a single document that exceeds the size limit, so you must pre-process
|
|
691
|
+
any such documents into smaller pieces before sending them to Elasticsearch.
|
|
692
|
+
For instance, split documents into pages or chapters before indexing them, or
|
|
693
|
+
store raw binary data in a system outside Elasticsearch and replace the raw data
|
|
694
|
+
with a link to the external system in the documents that you send to Elasticsearch.
|
|
695
|
+
**Client suppport for bulk requests** Some of the officially supported clients
|
|
696
|
+
provide helpers to assist with bulk requests and reindexing: * Go: Check out
|
|
697
|
+
`esutil.BulkIndexer` * Perl: Check out `Search::Elasticsearch::Client::5_0::Bulk`
|
|
698
|
+
and `Search::Elasticsearch::Client::5_0::Scroll` * Python: Check out `elasticsearch.helpers.*`
|
|
699
|
+
* JavaScript: Check out `client.helpers.*` * .NET: Check out `BulkAllObservable`
|
|
700
|
+
* PHP: Check out bulk indexing. **Submitting bulk requests with cURL** If you're
|
|
701
|
+
providing text file input to `curl`, you must use the `--data-binary` flag instead
|
|
702
|
+
of plain `-d`. The latter doesn't preserve newlines. For example: ``` $ cat requests
|
|
703
|
+
{ "index" : { "_index" : "test", "_id" : "1" } } { "field1" : "value1" } $ curl
|
|
704
|
+
-s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk --data-binary
|
|
705
|
+
"@requests"; echo {"took":7, "errors": false, "items":[{"index":{"_index":"test","_id":"1","_version":1,"result":"created","forced_refresh":false}}]}
|
|
706
|
+
``` **Optimistic concurrency control** Each `index` and `delete` action within
|
|
707
|
+
a bulk API call may include the `if_seq_no` and `if_primary_term` parameters
|
|
708
|
+
in their respective action and meta data lines. The `if_seq_no` and `if_primary_term`
|
|
709
|
+
parameters control how operations are run, based on the last modification to
|
|
710
|
+
existing documents. See Optimistic concurrency control for more details. **Versioning**
|
|
711
|
+
Each bulk item can include the version value using the `version` field. It automatically
|
|
712
|
+
follows the behavior of the index or delete operation based on the `_version`
|
|
713
|
+
mapping. It also support the `version_type`. **Routing** Each bulk item can include
|
|
714
|
+
the routing value using the `routing` field. It automatically follows the behavior
|
|
715
|
+
of the index or delete operation based on the `_routing` mapping. NOTE: Data
|
|
716
|
+
streams do not support custom routing unless they were created with the `allow_custom_routing`
|
|
717
|
+
setting enabled in the template. **Wait for active shards** When making bulk
|
|
718
|
+
calls, you can set the `wait_for_active_shards` parameter to require a minimum
|
|
719
|
+
number of shard copies to be active before starting to process the bulk request.
|
|
720
|
+
**Refresh** Control when the changes made by this request are visible to search.
|
|
721
|
+
NOTE: Only the shards that receive the bulk request will be affected by refresh.
|
|
722
|
+
Imagine a `_bulk?refresh=wait_for` request with three documents in it that happen
|
|
723
|
+
to be routed to different shards in an index with five shards. The request will
|
|
724
|
+
only wait for those three shards to refresh. The other two shards that make up
|
|
725
|
+
the index do not participate in the `_bulk` request at all.
|
|
650
726
|
|
|
651
727
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-bulk.html>`_
|
|
652
728
|
|
|
653
729
|
:param operations:
|
|
654
|
-
:param index:
|
|
730
|
+
:param index: The name of the data stream, index, or index alias to perform bulk
|
|
655
731
|
actions on.
|
|
656
732
|
:param list_executed_pipelines: If `true`, the response will include the ingest
|
|
657
|
-
pipelines that were
|
|
658
|
-
:param pipeline:
|
|
659
|
-
If the index has a default ingest pipeline specified,
|
|
660
|
-
|
|
661
|
-
pipeline is configured it will always run
|
|
733
|
+
pipelines that were run for each index or create.
|
|
734
|
+
:param pipeline: The pipeline identifier to use to preprocess incoming documents.
|
|
735
|
+
If the index has a default ingest pipeline specified, setting the value to
|
|
736
|
+
`_none` turns off the default ingest pipeline for this request. If a final
|
|
737
|
+
pipeline is configured, it will always run regardless of the value of this
|
|
662
738
|
parameter.
|
|
663
739
|
:param refresh: If `true`, Elasticsearch refreshes the affected shards to make
|
|
664
|
-
this operation visible to search
|
|
665
|
-
|
|
740
|
+
this operation visible to search. If `wait_for`, wait for a refresh to make
|
|
741
|
+
this operation visible to search. If `false`, do nothing with refreshes.
|
|
666
742
|
Valid values: `true`, `false`, `wait_for`.
|
|
667
|
-
:param require_alias: If `true`, the request
|
|
743
|
+
:param require_alias: If `true`, the request's actions must target an index alias.
|
|
668
744
|
:param require_data_stream: If `true`, the request's actions must target a data
|
|
669
|
-
stream (existing or to
|
|
670
|
-
:param routing:
|
|
671
|
-
|
|
672
|
-
|
|
745
|
+
stream (existing or to be created).
|
|
746
|
+
:param routing: A custom value that is used to route operations to a specific
|
|
747
|
+
shard.
|
|
748
|
+
:param source: Indicates whether to return the `_source` field (`true` or `false`)
|
|
749
|
+
or contains a list of fields to return.
|
|
673
750
|
:param source_excludes: A comma-separated list of source fields to exclude from
|
|
674
|
-
the response.
|
|
751
|
+
the response. You can also use this parameter to exclude fields from the
|
|
752
|
+
subset specified in `_source_includes` query parameter. If the `_source`
|
|
753
|
+
parameter is `false`, this parameter is ignored.
|
|
675
754
|
:param source_includes: A comma-separated list of source fields to include in
|
|
676
|
-
the response.
|
|
677
|
-
|
|
678
|
-
|
|
755
|
+
the response. If this parameter is specified, only these source fields are
|
|
756
|
+
returned. You can exclude fields from this subset using the `_source_excludes`
|
|
757
|
+
query parameter. If the `_source` parameter is `false`, this parameter is
|
|
758
|
+
ignored.
|
|
759
|
+
:param timeout: The period each action waits for the following operations: automatic
|
|
760
|
+
index creation, dynamic mapping updates, and waiting for active shards. The
|
|
761
|
+
default is `1m` (one minute), which guarantees Elasticsearch waits for at
|
|
762
|
+
least the timeout before failing. The actual wait time could be longer, particularly
|
|
763
|
+
when multiple waits occur.
|
|
679
764
|
:param wait_for_active_shards: The number of shard copies that must be active
|
|
680
|
-
before proceeding with the operation. Set to all or any positive integer
|
|
681
|
-
up to the total number of shards in the index (`number_of_replicas+1`).
|
|
765
|
+
before proceeding with the operation. Set to `all` or any positive integer
|
|
766
|
+
up to the total number of shards in the index (`number_of_replicas+1`). The
|
|
767
|
+
default is `1`, which waits for each primary shard to be active.
|
|
682
768
|
"""
|
|
683
769
|
if operations is None and body is None:
|
|
684
770
|
raise ValueError(
|
|
@@ -758,7 +844,7 @@ class AsyncElasticsearch(BaseClient):
|
|
|
758
844
|
|
|
759
845
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/clear-scroll-api.html>`_
|
|
760
846
|
|
|
761
|
-
:param scroll_id:
|
|
847
|
+
:param scroll_id: The scroll IDs to clear. To clear all scroll IDs, use `_all`.
|
|
762
848
|
"""
|
|
763
849
|
__path_parts: t.Dict[str, str] = {}
|
|
764
850
|
__path = "/_search/scroll"
|
|
@@ -882,46 +968,62 @@ class AsyncElasticsearch(BaseClient):
|
|
|
882
968
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
883
969
|
) -> ObjectApiResponse[t.Any]:
|
|
884
970
|
"""
|
|
885
|
-
Count search results. Get the number of documents matching a query.
|
|
971
|
+
Count search results. Get the number of documents matching a query. The query
|
|
972
|
+
can either be provided using a simple query string as a parameter or using the
|
|
973
|
+
Query DSL defined within the request body. The latter must be nested in a `query`
|
|
974
|
+
key, which is the same as the search API. The count API supports multi-target
|
|
975
|
+
syntax. You can run a single count API search across multiple data streams and
|
|
976
|
+
indices. The operation is broadcast across all shards. For each shard ID group,
|
|
977
|
+
a replica is chosen and the search is run against it. This means that replicas
|
|
978
|
+
increase the scalability of the count.
|
|
886
979
|
|
|
887
980
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-count.html>`_
|
|
888
981
|
|
|
889
|
-
:param index:
|
|
890
|
-
|
|
891
|
-
parameter or use `*` or `_all`.
|
|
982
|
+
:param index: A comma-separated list of data streams, indices, and aliases to
|
|
983
|
+
search. It supports wildcards (`*`). To search all data streams and indices,
|
|
984
|
+
omit this parameter or use `*` or `_all`.
|
|
892
985
|
:param allow_no_indices: If `false`, the request returns an error if any wildcard
|
|
893
986
|
expression, index alias, or `_all` value targets only missing or closed indices.
|
|
894
|
-
This behavior applies even if the request targets other open indices.
|
|
987
|
+
This behavior applies even if the request targets other open indices. For
|
|
988
|
+
example, a request targeting `foo*,bar*` returns an error if an index starts
|
|
989
|
+
with `foo` but no index starts with `bar`.
|
|
895
990
|
:param analyze_wildcard: If `true`, wildcard and prefix queries are analyzed.
|
|
896
|
-
This parameter can
|
|
897
|
-
:param analyzer:
|
|
898
|
-
be used when the `q` query string parameter is specified.
|
|
991
|
+
This parameter can be used only when the `q` query string parameter is specified.
|
|
992
|
+
:param analyzer: The analyzer to use for the query string. This parameter can
|
|
993
|
+
be used only when the `q` query string parameter is specified.
|
|
899
994
|
:param default_operator: The default operator for query string query: `AND` or
|
|
900
|
-
`OR`. This parameter can
|
|
995
|
+
`OR`. This parameter can be used only when the `q` query string parameter
|
|
901
996
|
is specified.
|
|
902
|
-
:param df:
|
|
903
|
-
string. This parameter can
|
|
997
|
+
:param df: The field to use as a default when no field prefix is given in the
|
|
998
|
+
query string. This parameter can be used only when the `q` query string parameter
|
|
904
999
|
is specified.
|
|
905
|
-
:param expand_wildcards:
|
|
906
|
-
request can target data streams, this argument determines whether
|
|
907
|
-
expressions match hidden data streams.
|
|
908
|
-
as `open,hidden`.
|
|
909
|
-
:param ignore_throttled: If `true`, concrete, expanded or aliased indices are
|
|
1000
|
+
:param expand_wildcards: The type of index that wildcard patterns can match.
|
|
1001
|
+
If the request can target data streams, this argument determines whether
|
|
1002
|
+
wildcard expressions match hidden data streams. It supports comma-separated
|
|
1003
|
+
values, such as `open,hidden`.
|
|
1004
|
+
:param ignore_throttled: If `true`, concrete, expanded, or aliased indices are
|
|
910
1005
|
ignored when frozen.
|
|
911
1006
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
912
1007
|
a missing or closed index.
|
|
913
1008
|
:param lenient: If `true`, format-based query failures (such as providing text
|
|
914
|
-
to a numeric field) in the query string will be ignored.
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
:param
|
|
921
|
-
:param
|
|
922
|
-
|
|
1009
|
+
to a numeric field) in the query string will be ignored. This parameter can
|
|
1010
|
+
be used only when the `q` query string parameter is specified.
|
|
1011
|
+
:param min_score: The minimum `_score` value that documents must have to be included
|
|
1012
|
+
in the result.
|
|
1013
|
+
:param preference: The node or shard the operation should be performed on. By
|
|
1014
|
+
default, it is random.
|
|
1015
|
+
:param q: The query in Lucene query string syntax.
|
|
1016
|
+
:param query: Defines the search definition using the Query DSL. The query is
|
|
1017
|
+
optional, and when not provided, it will use `match_all` to count all the
|
|
1018
|
+
docs.
|
|
1019
|
+
:param routing: A custom value used to route operations to a specific shard.
|
|
1020
|
+
:param terminate_after: The maximum number of documents to collect for each shard.
|
|
923
1021
|
If a query reaches this limit, Elasticsearch terminates the query early.
|
|
924
|
-
Elasticsearch collects documents before sorting.
|
|
1022
|
+
Elasticsearch collects documents before sorting. IMPORTANT: Use with caution.
|
|
1023
|
+
Elasticsearch applies this parameter to each shard handling the request.
|
|
1024
|
+
When possible, let Elasticsearch perform early termination automatically.
|
|
1025
|
+
Avoid specifying this parameter for requests that target data streams with
|
|
1026
|
+
backing indices across multiple data tiers.
|
|
925
1027
|
"""
|
|
926
1028
|
__path_parts: t.Dict[str, str]
|
|
927
1029
|
if index not in SKIP_IN_PATH:
|
|
@@ -2489,9 +2591,9 @@ class AsyncElasticsearch(BaseClient):
|
|
|
2489
2591
|
pretty: t.Optional[bool] = None,
|
|
2490
2592
|
) -> ObjectApiResponse[t.Any]:
|
|
2491
2593
|
"""
|
|
2492
|
-
Get cluster info.
|
|
2594
|
+
Get cluster info. Get basic build, version, and cluster information.
|
|
2493
2595
|
|
|
2494
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/
|
|
2596
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rest-api-root.html>`_
|
|
2495
2597
|
"""
|
|
2496
2598
|
__path_parts: t.Dict[str, str] = {}
|
|
2497
2599
|
__path = "/"
|