elasticsearch9 9.0.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.
- elasticsearch9/__init__.py +98 -0
- elasticsearch9/_async/__init__.py +16 -0
- elasticsearch9/_async/client/__init__.py +6531 -0
- elasticsearch9/_async/client/_base.py +430 -0
- elasticsearch9/_async/client/async_search.py +637 -0
- elasticsearch9/_async/client/autoscaling.py +252 -0
- elasticsearch9/_async/client/cat.py +2995 -0
- elasticsearch9/_async/client/ccr.py +1043 -0
- elasticsearch9/_async/client/cluster.py +1223 -0
- elasticsearch9/_async/client/connector.py +1978 -0
- elasticsearch9/_async/client/dangling_indices.py +192 -0
- elasticsearch9/_async/client/enrich.py +291 -0
- elasticsearch9/_async/client/eql.py +359 -0
- elasticsearch9/_async/client/esql.py +490 -0
- elasticsearch9/_async/client/features.py +130 -0
- elasticsearch9/_async/client/fleet.py +658 -0
- elasticsearch9/_async/client/graph.py +113 -0
- elasticsearch9/_async/client/ilm.py +668 -0
- elasticsearch9/_async/client/indices.py +5582 -0
- elasticsearch9/_async/client/inference.py +2247 -0
- elasticsearch9/_async/client/ingest.py +766 -0
- elasticsearch9/_async/client/license.py +400 -0
- elasticsearch9/_async/client/logstash.py +176 -0
- elasticsearch9/_async/client/migration.py +160 -0
- elasticsearch9/_async/client/ml.py +5835 -0
- elasticsearch9/_async/client/monitoring.py +100 -0
- elasticsearch9/_async/client/nodes.py +543 -0
- elasticsearch9/_async/client/query_rules.py +485 -0
- elasticsearch9/_async/client/rollup.py +616 -0
- elasticsearch9/_async/client/search_application.py +574 -0
- elasticsearch9/_async/client/searchable_snapshots.py +313 -0
- elasticsearch9/_async/client/security.py +4688 -0
- elasticsearch9/_async/client/shutdown.py +268 -0
- elasticsearch9/_async/client/simulate.py +145 -0
- elasticsearch9/_async/client/slm.py +559 -0
- elasticsearch9/_async/client/snapshot.py +1338 -0
- elasticsearch9/_async/client/sql.py +469 -0
- elasticsearch9/_async/client/ssl.py +76 -0
- elasticsearch9/_async/client/synonyms.py +413 -0
- elasticsearch9/_async/client/tasks.py +295 -0
- elasticsearch9/_async/client/text_structure.py +664 -0
- elasticsearch9/_async/client/transform.py +922 -0
- elasticsearch9/_async/client/utils.py +48 -0
- elasticsearch9/_async/client/watcher.py +894 -0
- elasticsearch9/_async/client/xpack.py +134 -0
- elasticsearch9/_async/helpers.py +596 -0
- elasticsearch9/_otel.py +110 -0
- elasticsearch9/_sync/__init__.py +16 -0
- elasticsearch9/_sync/client/__init__.py +6529 -0
- elasticsearch9/_sync/client/_base.py +430 -0
- elasticsearch9/_sync/client/async_search.py +637 -0
- elasticsearch9/_sync/client/autoscaling.py +252 -0
- elasticsearch9/_sync/client/cat.py +2995 -0
- elasticsearch9/_sync/client/ccr.py +1043 -0
- elasticsearch9/_sync/client/cluster.py +1223 -0
- elasticsearch9/_sync/client/connector.py +1978 -0
- elasticsearch9/_sync/client/dangling_indices.py +192 -0
- elasticsearch9/_sync/client/enrich.py +291 -0
- elasticsearch9/_sync/client/eql.py +359 -0
- elasticsearch9/_sync/client/esql.py +490 -0
- elasticsearch9/_sync/client/features.py +130 -0
- elasticsearch9/_sync/client/fleet.py +658 -0
- elasticsearch9/_sync/client/graph.py +113 -0
- elasticsearch9/_sync/client/ilm.py +668 -0
- elasticsearch9/_sync/client/indices.py +5582 -0
- elasticsearch9/_sync/client/inference.py +2247 -0
- elasticsearch9/_sync/client/ingest.py +766 -0
- elasticsearch9/_sync/client/license.py +400 -0
- elasticsearch9/_sync/client/logstash.py +176 -0
- elasticsearch9/_sync/client/migration.py +160 -0
- elasticsearch9/_sync/client/ml.py +5835 -0
- elasticsearch9/_sync/client/monitoring.py +100 -0
- elasticsearch9/_sync/client/nodes.py +543 -0
- elasticsearch9/_sync/client/query_rules.py +485 -0
- elasticsearch9/_sync/client/rollup.py +616 -0
- elasticsearch9/_sync/client/search_application.py +574 -0
- elasticsearch9/_sync/client/searchable_snapshots.py +313 -0
- elasticsearch9/_sync/client/security.py +4688 -0
- elasticsearch9/_sync/client/shutdown.py +268 -0
- elasticsearch9/_sync/client/simulate.py +145 -0
- elasticsearch9/_sync/client/slm.py +559 -0
- elasticsearch9/_sync/client/snapshot.py +1338 -0
- elasticsearch9/_sync/client/sql.py +469 -0
- elasticsearch9/_sync/client/ssl.py +76 -0
- elasticsearch9/_sync/client/synonyms.py +413 -0
- elasticsearch9/_sync/client/tasks.py +295 -0
- elasticsearch9/_sync/client/text_structure.py +664 -0
- elasticsearch9/_sync/client/transform.py +922 -0
- elasticsearch9/_sync/client/utils.py +475 -0
- elasticsearch9/_sync/client/watcher.py +894 -0
- elasticsearch9/_sync/client/xpack.py +134 -0
- elasticsearch9/_utils.py +34 -0
- elasticsearch9/_version.py +18 -0
- elasticsearch9/client.py +126 -0
- elasticsearch9/compat.py +79 -0
- elasticsearch9/dsl/__init__.py +203 -0
- elasticsearch9/dsl/_async/__init__.py +16 -0
- elasticsearch9/dsl/_async/document.py +522 -0
- elasticsearch9/dsl/_async/faceted_search.py +50 -0
- elasticsearch9/dsl/_async/index.py +639 -0
- elasticsearch9/dsl/_async/mapping.py +49 -0
- elasticsearch9/dsl/_async/search.py +237 -0
- elasticsearch9/dsl/_async/update_by_query.py +47 -0
- elasticsearch9/dsl/_sync/__init__.py +16 -0
- elasticsearch9/dsl/_sync/document.py +514 -0
- elasticsearch9/dsl/_sync/faceted_search.py +50 -0
- elasticsearch9/dsl/_sync/index.py +597 -0
- elasticsearch9/dsl/_sync/mapping.py +49 -0
- elasticsearch9/dsl/_sync/search.py +230 -0
- elasticsearch9/dsl/_sync/update_by_query.py +45 -0
- elasticsearch9/dsl/aggs.py +3734 -0
- elasticsearch9/dsl/analysis.py +341 -0
- elasticsearch9/dsl/async_connections.py +37 -0
- elasticsearch9/dsl/connections.py +142 -0
- elasticsearch9/dsl/document.py +20 -0
- elasticsearch9/dsl/document_base.py +444 -0
- elasticsearch9/dsl/exceptions.py +32 -0
- elasticsearch9/dsl/faceted_search.py +28 -0
- elasticsearch9/dsl/faceted_search_base.py +489 -0
- elasticsearch9/dsl/field.py +4392 -0
- elasticsearch9/dsl/function.py +180 -0
- elasticsearch9/dsl/index.py +23 -0
- elasticsearch9/dsl/index_base.py +178 -0
- elasticsearch9/dsl/mapping.py +19 -0
- elasticsearch9/dsl/mapping_base.py +219 -0
- elasticsearch9/dsl/query.py +2822 -0
- elasticsearch9/dsl/response/__init__.py +388 -0
- elasticsearch9/dsl/response/aggs.py +100 -0
- elasticsearch9/dsl/response/hit.py +53 -0
- elasticsearch9/dsl/search.py +20 -0
- elasticsearch9/dsl/search_base.py +1053 -0
- elasticsearch9/dsl/serializer.py +34 -0
- elasticsearch9/dsl/types.py +6453 -0
- elasticsearch9/dsl/update_by_query.py +19 -0
- elasticsearch9/dsl/update_by_query_base.py +149 -0
- elasticsearch9/dsl/utils.py +687 -0
- elasticsearch9/dsl/wrappers.py +144 -0
- elasticsearch9/exceptions.py +133 -0
- elasticsearch9/helpers/__init__.py +41 -0
- elasticsearch9/helpers/actions.py +875 -0
- elasticsearch9/helpers/errors.py +40 -0
- elasticsearch9/helpers/vectorstore/__init__.py +62 -0
- elasticsearch9/helpers/vectorstore/_async/__init__.py +16 -0
- elasticsearch9/helpers/vectorstore/_async/_utils.py +39 -0
- elasticsearch9/helpers/vectorstore/_async/embedding_service.py +89 -0
- elasticsearch9/helpers/vectorstore/_async/strategies.py +487 -0
- elasticsearch9/helpers/vectorstore/_async/vectorstore.py +421 -0
- elasticsearch9/helpers/vectorstore/_sync/__init__.py +16 -0
- elasticsearch9/helpers/vectorstore/_sync/_utils.py +39 -0
- elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +89 -0
- elasticsearch9/helpers/vectorstore/_sync/strategies.py +487 -0
- elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +421 -0
- elasticsearch9/helpers/vectorstore/_utils.py +116 -0
- elasticsearch9/py.typed +0 -0
- elasticsearch9/serializer.py +250 -0
- elasticsearch9-9.0.0.dist-info/METADATA +175 -0
- elasticsearch9-9.0.0.dist-info/RECORD +160 -0
- elasticsearch9-9.0.0.dist-info/WHEEL +4 -0
- elasticsearch9-9.0.0.dist-info/licenses/LICENSE +176 -0
- elasticsearch9-9.0.0.dist-info/licenses/NOTICE +2 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
|
3
|
+
# this work for additional information regarding copyright
|
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
+
# not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
# KIND, either express or implied. See the License for the
|
|
15
|
+
# specific language governing permissions and limitations
|
|
16
|
+
# under the License.
|
|
17
|
+
|
|
18
|
+
import typing as t
|
|
19
|
+
|
|
20
|
+
from elastic_transport import ObjectApiResponse
|
|
21
|
+
|
|
22
|
+
from ._base import NamespacedClient
|
|
23
|
+
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class GraphClient(NamespacedClient):
|
|
27
|
+
|
|
28
|
+
@_rewrite_parameters(
|
|
29
|
+
body_fields=("connections", "controls", "query", "vertices"),
|
|
30
|
+
)
|
|
31
|
+
def explore(
|
|
32
|
+
self,
|
|
33
|
+
*,
|
|
34
|
+
index: t.Union[str, t.Sequence[str]],
|
|
35
|
+
connections: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
36
|
+
controls: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
37
|
+
error_trace: t.Optional[bool] = None,
|
|
38
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
39
|
+
human: t.Optional[bool] = None,
|
|
40
|
+
pretty: t.Optional[bool] = None,
|
|
41
|
+
query: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
42
|
+
routing: t.Optional[str] = None,
|
|
43
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
44
|
+
vertices: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
45
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
46
|
+
) -> ObjectApiResponse[t.Any]:
|
|
47
|
+
"""
|
|
48
|
+
.. raw:: html
|
|
49
|
+
|
|
50
|
+
<p>Explore graph analytics.
|
|
51
|
+
Extract and summarize information about the documents and terms in an Elasticsearch data stream or index.
|
|
52
|
+
The easiest way to understand the behavior of this API is to use the Graph UI to explore connections.
|
|
53
|
+
An initial request to the <code>_explore</code> API contains a seed query that identifies the documents of interest and specifies the fields that define the vertices and connections you want to include in the graph.
|
|
54
|
+
Subsequent requests enable you to spider out from one more vertices of interest.
|
|
55
|
+
You can exclude vertices that have already been returned.</p>
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/group/endpoint-graph>`_
|
|
59
|
+
|
|
60
|
+
:param index: Name of the index.
|
|
61
|
+
:param connections: Specifies or more fields from which you want to extract terms
|
|
62
|
+
that are associated with the specified vertices.
|
|
63
|
+
:param controls: Direct the Graph API how to build the graph.
|
|
64
|
+
:param query: A seed query that identifies the documents of interest. Can be
|
|
65
|
+
any valid Elasticsearch query.
|
|
66
|
+
:param routing: Custom value used to route operations to a specific shard.
|
|
67
|
+
:param timeout: Specifies the period of time to wait for a response from each
|
|
68
|
+
shard. If no response is received before the timeout expires, the request
|
|
69
|
+
fails and returns an error. Defaults to no timeout.
|
|
70
|
+
:param vertices: Specifies one or more fields that contain the terms you want
|
|
71
|
+
to include in the graph as vertices.
|
|
72
|
+
"""
|
|
73
|
+
if index in SKIP_IN_PATH:
|
|
74
|
+
raise ValueError("Empty value passed for parameter 'index'")
|
|
75
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
76
|
+
__path = f'/{__path_parts["index"]}/_graph/explore'
|
|
77
|
+
__query: t.Dict[str, t.Any] = {}
|
|
78
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
79
|
+
if error_trace is not None:
|
|
80
|
+
__query["error_trace"] = error_trace
|
|
81
|
+
if filter_path is not None:
|
|
82
|
+
__query["filter_path"] = filter_path
|
|
83
|
+
if human is not None:
|
|
84
|
+
__query["human"] = human
|
|
85
|
+
if pretty is not None:
|
|
86
|
+
__query["pretty"] = pretty
|
|
87
|
+
if routing is not None:
|
|
88
|
+
__query["routing"] = routing
|
|
89
|
+
if timeout is not None:
|
|
90
|
+
__query["timeout"] = timeout
|
|
91
|
+
if not __body:
|
|
92
|
+
if connections is not None:
|
|
93
|
+
__body["connections"] = connections
|
|
94
|
+
if controls is not None:
|
|
95
|
+
__body["controls"] = controls
|
|
96
|
+
if query is not None:
|
|
97
|
+
__body["query"] = query
|
|
98
|
+
if vertices is not None:
|
|
99
|
+
__body["vertices"] = vertices
|
|
100
|
+
if not __body:
|
|
101
|
+
__body = None # type: ignore[assignment]
|
|
102
|
+
__headers = {"accept": "application/json"}
|
|
103
|
+
if __body is not None:
|
|
104
|
+
__headers["content-type"] = "application/json"
|
|
105
|
+
return self.perform_request( # type: ignore[return-value]
|
|
106
|
+
"POST",
|
|
107
|
+
__path,
|
|
108
|
+
params=__query,
|
|
109
|
+
headers=__headers,
|
|
110
|
+
body=__body,
|
|
111
|
+
endpoint_id="graph.explore",
|
|
112
|
+
path_parts=__path_parts,
|
|
113
|
+
)
|