Skip to content

Commit f250598

Browse files
authored
Add Synonyms and Query rules APIs (#2299)
1 parent 6ec5c9e commit f250598

32 files changed

+3344
-1692
lines changed

docs/sphinx/api.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ Nodes
144144
.. autoclass:: NodesClient
145145
:members:
146146

147+
Query rules
148+
-----------
149+
150+
.. autoclass:: QueryRulesetClient
151+
:members:
152+
147153
Rollup Indices
148154
--------------
149155

@@ -192,6 +198,12 @@ SQL
192198
.. autoclass:: SqlClient
193199
:members:
194200

201+
Synonyms
202+
--------
203+
204+
.. autoclass:: SynonymsClient
205+
:members:
206+
195207
TLS/SSL
196208
-------
197209

elasticsearch/_async/client/__init__.py

Lines changed: 499 additions & 412 deletions
Large diffs are not rendered by default.

elasticsearch/_async/client/enrich.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def delete_policy(
4141
4242
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-enrich-policy-api.html>`_
4343
44-
:param name: The name of the enrich policy
44+
:param name: Enrich policy to delete.
4545
"""
4646
if name in SKIP_IN_PATH:
4747
raise ValueError("Empty value passed for parameter 'name'")
@@ -78,9 +78,9 @@ async def execute_policy(
7878
7979
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/execute-enrich-policy-api.html>`_
8080
81-
:param name: The name of the enrich policy
82-
:param wait_for_completion: Should the request should block until the execution
83-
is complete.
81+
:param name: Enrich policy to execute.
82+
:param wait_for_completion: If `true`, the request blocks other enrich policy
83+
execution requests until complete.
8484
"""
8585
if name in SKIP_IN_PATH:
8686
raise ValueError("Empty value passed for parameter 'name'")
@@ -118,7 +118,8 @@ async def get_policy(
118118
119119
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/get-enrich-policy-api.html>`_
120120
121-
:param name: A comma-separated list of enrich policy names
121+
:param name: Comma-separated list of enrich policy names used to limit the request.
122+
To return information for all enrich policies, omit this parameter.
122123
"""
123124
if name not in SKIP_IN_PATH:
124125
__path = f"/_enrich/policy/{_quote(name)}"
@@ -160,10 +161,12 @@ async def put_policy(
160161
161162
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/put-enrich-policy-api.html>`_
162163
163-
:param name: The name of the enrich policy
164-
:param geo_match:
165-
:param match:
166-
:param range:
164+
:param name: Name of the enrich policy to create or update.
165+
:param geo_match: Matches enrich data to incoming documents based on a `geo_shape`
166+
query.
167+
:param match: Matches enrich data to incoming documents based on a `term` query.
168+
:param range: Matches a number, date, or IP address in incoming documents to
169+
a range in the enrich index based on a `term` query.
167170
"""
168171
if name in SKIP_IN_PATH:
169172
raise ValueError("Empty value passed for parameter 'name'")

elasticsearch/_async/client/eql.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ async def delete(
4242
4343
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html>`_
4444
45-
:param id: Identifier for the search to delete.
45+
:param id: Identifier for the search to delete. A search ID is provided in the
46+
EQL search API's response for an async search. A search ID is also provided
47+
if the request’s `keep_on_completion` parameter is `true`.
4648
"""
4749
if id in SKIP_IN_PATH:
4850
raise ValueError("Empty value passed for parameter 'id'")
@@ -80,7 +82,7 @@ async def get(
8082
"""
8183
Returns async results from previously executed Event Query Language (EQL) search
8284
83-
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html>`_
85+
`< https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html>`_
8486
8587
:param id: Identifier for the search.
8688
:param keep_alive: Period for which the search and its results are stored on
@@ -127,7 +129,7 @@ async def get_status(
127129
Returns the status of a previously submitted async or stored Event Query Language
128130
(EQL) search
129131
130-
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html>`_
132+
`< https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html>`_
131133
132134
:param id: Identifier for the search.
133135
"""

elasticsearch/_async/client/graph.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@ async def explore(
5252
5353
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/graph-explore-api.html>`_
5454
55-
:param index: A comma-separated list of index names to search; use `_all` or
56-
empty string to perform the operation on all indices
57-
:param connections:
58-
:param controls:
59-
:param query:
60-
:param routing: Specific routing value
61-
:param timeout: Explicit operation timeout
62-
:param vertices:
55+
:param index: Name of the index.
56+
:param connections: Specifies or more fields from which you want to extract terms
57+
that are associated with the specified vertices.
58+
:param controls: Direct the Graph API how to build the graph.
59+
:param query: A seed query that identifies the documents of interest. Can be
60+
any valid Elasticsearch query.
61+
:param routing: Custom value used to route operations to a specific shard.
62+
:param timeout: Specifies the period of time to wait for a response from each
63+
shard. If no response is received before the timeout expires, the request
64+
fails and returns an error. Defaults to no timeout.
65+
:param vertices: Specifies one or more fields that contain the terms you want
66+
to include in the graph as vertices.
6367
"""
6468
if index in SKIP_IN_PATH:
6569
raise ValueError("Empty value passed for parameter 'index'")

0 commit comments

Comments
 (0)