Skip to content

Add Synonyms and Query rules APIs #2299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/sphinx/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ Nodes
.. autoclass:: NodesClient
:members:

Query rules
-----------

.. autoclass:: QueryRulesetClient
:members:

Rollup Indices
--------------

Expand Down Expand Up @@ -192,6 +198,12 @@ SQL
.. autoclass:: SqlClient
:members:

Synonyms
--------

.. autoclass:: SynonymsClient
:members:

TLS/SSL
-------

Expand Down
911 changes: 499 additions & 412 deletions elasticsearch/_async/client/__init__.py

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions elasticsearch/_async/client/enrich.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def delete_policy(

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-enrich-policy-api.html>`_

:param name: The name of the enrich policy
:param name: Enrich policy to delete.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand Down Expand Up @@ -78,9 +78,9 @@ async def execute_policy(

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/execute-enrich-policy-api.html>`_

:param name: The name of the enrich policy
:param wait_for_completion: Should the request should block until the execution
is complete.
:param name: Enrich policy to execute.
:param wait_for_completion: If `true`, the request blocks other enrich policy
execution requests until complete.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand Down Expand Up @@ -118,7 +118,8 @@ async def get_policy(

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/get-enrich-policy-api.html>`_

:param name: A comma-separated list of enrich policy names
:param name: Comma-separated list of enrich policy names used to limit the request.
To return information for all enrich policies, omit this parameter.
"""
if name not in SKIP_IN_PATH:
__path = f"/_enrich/policy/{_quote(name)}"
Expand Down Expand Up @@ -160,10 +161,12 @@ async def put_policy(

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/put-enrich-policy-api.html>`_

:param name: The name of the enrich policy
:param geo_match:
:param match:
:param range:
:param name: Name of the enrich policy to create or update.
:param geo_match: Matches enrich data to incoming documents based on a `geo_shape`
query.
:param match: Matches enrich data to incoming documents based on a `term` query.
:param range: Matches a number, date, or IP address in incoming documents to
a range in the enrich index based on a `term` query.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand Down
8 changes: 5 additions & 3 deletions elasticsearch/_async/client/eql.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ async def delete(

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html>`_

:param id: Identifier for the search to delete.
:param id: Identifier for the search to delete. A search ID is provided in the
EQL search API's response for an async search. A search ID is also provided
if the request’s `keep_on_completion` parameter is `true`.
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'id'")
Expand Down Expand Up @@ -80,7 +82,7 @@ async def get(
"""
Returns async results from previously executed Event Query Language (EQL) search

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html>`_
`< https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-search-api.html>`_

:param id: Identifier for the search.
:param keep_alive: Period for which the search and its results are stored on
Expand Down Expand Up @@ -127,7 +129,7 @@ async def get_status(
Returns the status of a previously submitted async or stored Event Query Language
(EQL) search

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/eql-search-api.html>`_
`< https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-eql-status-api.html>`_

:param id: Identifier for the search.
"""
Expand Down
20 changes: 12 additions & 8 deletions elasticsearch/_async/client/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@ async def explore(

`<https://www.elastic.co/guide/en/elasticsearch/reference/master/graph-explore-api.html>`_

:param index: A comma-separated list of index names to search; use `_all` or
empty string to perform the operation on all indices
:param connections:
:param controls:
:param query:
:param routing: Specific routing value
:param timeout: Explicit operation timeout
:param vertices:
:param index: Name of the index.
:param connections: Specifies or more fields from which you want to extract terms
that are associated with the specified vertices.
:param controls: Direct the Graph API how to build the graph.
:param query: A seed query that identifies the documents of interest. Can be
any valid Elasticsearch query.
:param routing: Custom value used to route operations to a specific shard.
:param timeout: Specifies the period of time to wait for a response from each
shard. If no response is received before the timeout expires, the request
fails and returns an error. Defaults to no timeout.
:param vertices: Specifies one or more fields that contain the terms you want
to include in the graph as vertices.
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'index'")
Expand Down
Loading