Removed Elastic Doc Reference

Signed-off-by: Shephali Mittal <shephalm@amazon.com>
This commit is contained in:
Shephali Mittal
2021-08-13 11:45:36 +05:30
committed by shephali mittal
parent 07c21725e8
commit 064213a9ed
48 changed files with 1 additions and 2608 deletions
-3
View File
@@ -68,9 +68,6 @@ instance/
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/sphinx/_build/
# PyBuilder
.pybuilder/
target/
-2
View File
@@ -1,6 +1,4 @@
version: 2
sphinx:
configuration: docs/sphinx/conf.py
python:
version: 3.7
-1
View File
@@ -1 +0,0 @@
Release notes have moved to `elastic.co/guide <https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/release-notes.html>`_.
-2
View File
@@ -6,9 +6,7 @@ include MANIFEST.in
include README.md
include setup.py
recursive-include elasticsearch* py.typed *.pyi
recursive-include docs/sphinx *
prune docs/sphinx/_build
prune test_elasticsearch
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
-12
View File
@@ -1,12 +0,0 @@
[[config]]
== Configuration
This page contains information about the most important configuration options of
the Python {es} client.
* <<connection-pool>>
* <<connection-selector>>
include::connection-pool.asciidoc[]
include::connection-selector.asciidoc[]
-68
View File
@@ -1,68 +0,0 @@
[[connecting]]
== Connecting
This page contains the information you need to connect the Client with {es}.
[discrete]
[[authentication]]
=== Authentication
This section contains code snippets to show you how to connect to various {es}
providers.
[discrete]
[[auth-ec]]
==== Elastic Cloud
Cloud ID is an easy way to configure your client to work with your Elastic Cloud
deployment. Combine the `cloud_id` with either `http_auth` or `api_key` to
authenticate with your Elastic Cloud deployment.
Using `cloud_id` enables TLS verification and HTTP compression by default and
sets the port to 443 unless otherwise overwritten via the port parameter or the
port value encoded within `cloud_id`. Using Cloud ID also disables sniffing.
[source,py]
----------------------------
from elasticsearch import Elasticsearch
es = Elasticsearch(
cloud_id=”cluster-1:dXMa5Fx...”
)
----------------------------
[discrete]
[[auth-http]]
==== HTTP Authentication
HTTP authentication uses the `http_auth` parameter by passing in a username and
password within a tuple:
[source,py]
----------------------------
from elasticsearch import Elasticsearch
es = Elasticsearch(
http_auth=(“username”, “password”)
)
----------------------------
[discrete]
[[auth-apikey]]
==== ApiKey authentication
You can configure the client to use {es}'s API Key for connecting to your
cluster.
[source,py]
----------------------------
from elasticsearch import Elasticsearch
es = Elasticsearch(
api_key=(“api_key_id”, “api_key_secret”)
)
----------------------------
-18
View File
@@ -1,18 +0,0 @@
[[connection-pool]]
=== Connection pool
Connection pool is a container that holds the `Connection` instances, manages
the selection process (via a `ConnectionSelector`) and dead connections.
Initially connections are stored in the class as a list and along with the
connection options get passed to the `ConnectionSelector` instance for future
reference.
Upon each request, the `Transport` asks for a `Connection` via the
`get_connection` method. If the connection fails, it is marked as dead (via
`mark_dead`) and put on a timeout. When the timeout is over the connection is
resurrected and returned to the live pool. A connection that has been previously
marked as dead and then succeeds is marked as live (its fail count is deleted).
For reference information, refer to the
https://elasticsearch-py.readthedocs.io/en/latest/connection.html#connection-pool[full {es} Python documentation].
-20
View File
@@ -1,20 +0,0 @@
[[connection-selector]]
=== Connection selector
Connection selector is a simple class used to select a connection from a list of
currently live connection instances. Initially, it is passed a dictionary
containing all the connections options which it can then use during the
selection process. When the _select_ method is called it is given a list of
currently live connections to choose from.
The options dictionary is passed to `Transport` as the hosts parameter and the
same is used to construct the connection object itself. When the connection was
created based on information retrieved from the cluster via the sniffing
process, it is the dictionary returned by the `host_info_callback`.
Example of where this might be useful is a zone-aware selector that would only
select connections from its own zones and only fall back to other connections
where there would be none in its zones.
For reference information, refer to the
https://elasticsearch-py.readthedocs.io/en/latest/connection.html#connection-selector[full {es} Python documentation].
-110
View File
@@ -1,110 +0,0 @@
[[examples]]
== Examples
Below you can find examples of how to use the most frequently called APIs with
the Python client.
* <<ex-index>>
* <<ex-get>>
* <<ex-refresh>>
* <<ex-search>>
* <<ex-update>>
* <<ex-delete>>
[discrete]
[[ex-index]]
=== Indexing a document
To index a document, you need to specify three pieces of information: `index`,
`id`, and a `body`:
[source,py]
----------------------------
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
doc = {
'author': 'author_name',
'text': 'Interesting content...',
'timestamp': datetime.now(),
}
res = es.index(index="test-index", id=1, body=doc)
print(res['result'])
----------------------------
[discrete]
[[ex-get]]
=== Getting a document
To get a document, you need to specify its `index` and `id`:
[source,py]
----------------------------
res = es.get(index="test-index", id=1)
print(res['_source'])
----------------------------
[discrete]
[[ex-refresh]]
=== Refreshing an index
You can perform the refresh operation on an index:
[source,py]
----------------------------
es.indices.refresh(index="test-index")
----------------------------
[discrete]
[[ex-search]]
=== Searching for a document
The `search()` method returns results that are matching a query:
[source,py]
----------------------------
res = es.search(index="test-index", body={"query": {"match_all": {}}})
print("Got %d Hits:" % res['hits']['total']['value'])
for hit in res['hits']['hits']:
print("%(timestamp)s %(author)s: %(text)s" % hit["_source"])
----------------------------
[discrete]
[[ex-update]]
=== Updating a document
To update a document, you need to specify three pieces of information: `index`,
`id`, and a `body`:
[source,py]
----------------------------
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
doc = {
'author': 'author_name',
'text': 'Interesting modified content...',
'timestamp': datetime.now(),
}
res = es.update(index="test-index", id=1, body=doc)
print(res['result'])
----------------------------
[discrete]
[[ex-delete]]
=== Deleting a document
You can delete a document by specifying its `index`, and `id` in the `delete()`
method:
[source,py]
----------------------------
es.delete(index="test-index", id=1)
----------------------------
-94
View File
@@ -1,94 +0,0 @@
[[client-helpers]]
== Client helpers
You can find here a collection of simple helper functions that abstract some
specifics of the raw API. For detailed examples, refer to
https://elasticsearch-py.readthedocs.io/en/stable/helpers.html[this page].
[discrete]
[[bulk-helpers]]
=== Bulk helpers
There are several helpers for the bulk API since its requirement for specific
formatting and other considerations can make it cumbersome if used directly.
All bulk helpers accept an instance of `{es}` class and an iterable `action`
(any iterable, can also be a generator, which is ideal in most cases since it
allows you to index large datasets without the need of loading them into
memory).
The items in the iterable `action` should be the documents we wish to index in
several formats. The most common one is the same as returned by `search()`, for
example:
[source,yml]
----------------------------
{
'_index': 'index-name',
'_type': 'document',
'_id': 42,
'_routing': 5,
'pipeline': 'my-ingest-pipeline',
'_source': {
"title": "Hello World!",
"body": "..."
}
}
----------------------------
Alternatively, if `_source` is not present, it pops all metadata fields from
the doc and use the rest as the document data:
[source,yml]
----------------------------
{
"_id": 42,
"_routing": 5,
"title": "Hello World!",
"body": "..."
}
----------------------------
The `bulk()` api accepts `index`, `create`, `delete`, and `update` actions. Use
the `_op_type` field to specify an action (`_op_type` defaults to `index`):
[source,yml]
----------------------------
{
'_op_type': 'delete',
'_index': 'index-name',
'_type': 'document',
'_id': 42,
}
{
'_op_type': 'update',
'_index': 'index-name',
'_type': 'document',
'_id': 42,
'doc': {'question': 'The life, universe and everything.'}
}
----------------------------
[discrete]
[[scan]]
=== Scan
Simple abstraction on top of the `scroll()` API - a simple iterator that yields
all hits as returned by underlining scroll requests.
By default scan does not return results in any pre-determined order. To have a
standard order in the returned documents (either by score or explicit sort
definition) when scrolling, use `preserve_order=True`. This may be an expensive
operation and will negate the performance benefits of using `scan`.
[source,py]
----------------------------
scan(es,
query={"query": {"match": {"title": "python"}}},
index="orders-*",
doc_type="books"
)
----------------------------
-21
View File
@@ -1,21 +0,0 @@
= elasticsearch-py
:doctype: book
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
include::overview.asciidoc[]
include::installation.asciidoc[]
include::connecting.asciidoc[]
include::configuration.asciidoc[]
include::integrations.asciidoc[]
include::examples.asciidoc[]
include::helpers.asciidoc[]
include::release-notes.asciidoc[]
-20
View File
@@ -1,20 +0,0 @@
[[installation]]
== Installation
The Python client for {es} can be installed with pip:
[source,sh]
-------------------------------------
$ python -m pip install elasticsearch
-------------------------------------
If your application uses async/await in Python you can install with the `async`
extra:
[source,sh]
--------------------------------------------
$ python -m pip install elasticsearch[async]
--------------------------------------------
Read more about
https://elasticsearch-py.readthedocs.io/en/master/async.html[how to use Asyncio with this project].
-27
View File
@@ -1,27 +0,0 @@
[[integrations]]
== Integrations
You can find integration options and information on this page.
[discrete]
[[transport]]
=== Transport
The `Transport` class is a subclass of the
https://elasticsearch-py.readthedocs.io/en/latest/connection.html[Connection Layer API]
that contains all the classes that are responsible for handling the connection
to the {es} cluster.
The `Transport` class is an encapsulation of the transport-related logic of the
Python client. For the exhaustive list of parameters, refer to the
https://elasticsearch-py.readthedocs.io/en/latest/connection.html#transport[documentation].
[discrete]
[[transport-classes]]
==== Transport classes
The `Transport` classes can be used to maintain connection with an {es} cluster.
For the reference information of these classes, refer to the
https://elasticsearch-py.readthedocs.io/en/latest/transports.html[documentation].
-121
View File
@@ -1,121 +0,0 @@
[[overview]]
== Overview
This is the official low-level Python client for {es}. Its goal is to provide
common ground for all {es}-related code in Python. For this reason, the client
is designed to be unopinionated and extendable. Full documentation is available
on https://elasticsearch-py.readthedocs.io[Read the Docs].
[discrete]
=== Compatibility
Current development happens in the master branch.
The library is compatible with all Elasticsearch versions since `0.90.x` but you
**have to use a matching major version**:
For **Elasticsearch 7.0** and later, use the major version 7 (`7.x.y`) of the
library.
For **Elasticsearch 6.0** and later, use the major version 6 (`6.x.y`) of the
library.
For **Elasticsearch 5.0** and later, use the major version 5 (`5.x.y`) of the
library.
For **Elasticsearch 2.0** and later, use the major version 2 (`2.x.y`) of the
library, and so on.
The recommended way to set your requirements in your `setup.py` or
`requirements.txt` is::
# Elasticsearch 7.x
elasticsearch>=7,<8
# Elasticsearch 6.x
elasticsearch>=6,<7
# Elasticsearch 5.x
elasticsearch>=5,<6
# Elasticsearch 2.x
elasticsearch>=2,<3
If you have a need to have multiple versions installed at the same time older
versions are also released as `elasticsearch2` and `elasticsearch5`.
[discrete]
=== Example use
Simple use-case:
[source,python]
------------------------------------
>>> from datetime import datetime
>>> from elasticsearch import Elasticsearch
# By default we connect to localhost:9200
>>> es = Elasticsearch()
# Datetimes will be serialized...
>>> es.index(index="my-index-000001", doc_type="test-type", id=42, body={"any": "data", "timestamp": datetime.now()})
{'_id': '42', '_index': 'my-index-000001', '_type': 'test-type', '_version': 1, 'ok': True}
# ...but not deserialized
>>> es.get(index="my-index-000001", doc_type="test-type", id=42)['_source']
{'any': 'data', 'timestamp': '2013-05-12T19:45:31.804229'}
------------------------------------
[NOTE]
All the API calls map the raw REST API as closely as possible, including
the distinction between required and optional arguments to the calls. This
means that the code makes distinction between positional and keyword arguments;
we, however, recommend that people use keyword arguments for all calls for
consistency and safety.
[discrete]
=== Features
The client's features include:
* Translating basic Python data types to and from JSON
* Configurable automatic discovery of cluster nodes
* Persistent connections
* Load balancing (with pluggable selection strategy) across all available nodes
* Failed connection penalization (time based - failed connections won't be
retried until a timeout is reached)
* Thread safety
* Pluggable architecture
The client also contains a convenient set of
https://elasticsearch-py.readthedocs.org/en/master/helpers.html[helpers] for
some of the more engaging tasks like bulk indexing and reindexing.
[discrete]
=== Elasticsearch DSL
For a more high level client library with more limited scope, have a look at
https://elasticsearch-dsl.readthedocs.org/[elasticsearch-dsl] - a more Pythonic library
sitting on top of `elasticsearch-py`.
It provides a more convenient and idiomatic way to write and manipulate
https://elasticsearch-dsl.readthedocs.org/en/latest/search_dsl.html[queries]. It
stays close to the Elasticsearch JSON DSL, mirroring its terminology and
structure while exposing the whole range of the DSL from Python either directly
using defined classes or a queryset-like expressions.
It also provides an optional
https://elasticsearch-dsl.readthedocs.org/en/latest/persistence.html#doctype[persistence
layer] for working with documents as Python objects in an ORM-like fashion:
defining mappings, retrieving and saving documents, wrapping the document data
in user-defined classes.
-177
View File
@@ -1,177 +0,0 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Elasticsearch.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Elasticsearch.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Elasticsearch"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Elasticsearch"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
-302
View File
@@ -1,302 +0,0 @@
.. _api:
API Documentation
=================
All the API calls map the raw REST api as closely as possible, including the
distinction between required and optional arguments to the calls. This means
that the code makes distinction between positional and keyword arguments; we,
however, recommend that people **use keyword arguments for all calls for
consistency and safety**.
.. note::
for compatibility with the Python ecosystem we use ``from_`` instead of
``from`` and ``doc_type`` instead of ``type`` as parameter names.
Global Options
--------------
Some parameters are added by the client itself and can be used in all API
calls.
Ignore
~~~~~~
An API call is considered successful (and will return a response) if
elasticsearch returns a 2XX response. Otherwise an instance of
:class:`~elasticsearch.TransportError` (or a more specific subclass) will be
raised. You can see other exception and error states in :ref:`exceptions`. If
you do not wish an exception to be raised you can always pass in an ``ignore``
parameter with either a single status code that should be ignored or a list of
them:
.. code-block:: python
from elasticsearch import Elasticsearch
es = Elasticsearch()
# ignore 400 cause by IndexAlreadyExistsException when creating an index
es.indices.create(index='test-index', ignore=400)
# ignore 404 and 400
es.indices.delete(index='test-index', ignore=[400, 404])
Timeout
~~~~~~~
Global timeout can be set when constructing the client (see
:class:`~elasticsearch.Connection`'s ``timeout`` parameter) or on a per-request
basis using ``request_timeout`` (float value in seconds) as part of any API
call, this value will get passed to the ``perform_request`` method of the
connection class:
.. code-block:: python
# only wait for 1 second, regardless of the client's default
es.cluster.health(wait_for_status='yellow', request_timeout=1)
.. note::
Some API calls also accept a ``timeout`` parameter that is passed to
Elasticsearch server. This timeout is internal and doesn't guarantee that the
request will end in the specified time.
Tracking Requests with Opaque ID
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can enrich your requests against Elasticsearch with an identifier string, that allows you to discover this identifier
in `deprecation logs <https://www.elastic.co/guide/en/elasticsearch/reference/7.4/logging.html#deprecation-logging>`_, to support you with
`identifying search slow log origin <https://www.elastic.co/guide/en/elasticsearch/reference/7.4/index-modules-slowlog.html#_identifying_search_slow_log_origin>`_
or to help with `identifying running tasks <https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html#_identifying_running_tasks>`_.
.. code-block:: python
from elasticsearch import Elasticsearch
client = Elasticsearch()
# You can apply X-Opaque-Id in any API request via 'opaque_id':
resp = client.get(index="test", id="1", opaque_id="request-1")
.. py:module:: elasticsearch
Response Filtering
~~~~~~~~~~~~~~~~~~
The ``filter_path`` parameter is used to reduce the response returned by
elasticsearch. For example, to only return ``_id`` and ``_type``, do:
.. code-block:: python
es.search(index='test-index', filter_path=['hits.hits._id', 'hits.hits._type'])
It also supports the ``*`` wildcard character to match any field or part of a
field's name:
.. code-block:: python
es.search(index='test-index', filter_path=['hits.hits._*'])
Elasticsearch
-------------
.. autoclass:: Elasticsearch
:members:
.. py:module:: elasticsearch.client
Async Search
------------
.. autoclass:: AsyncSearchClient
:members:
Autoscaling
-----------
.. autoclass:: AutoscalingClient
:members:
Cat
---
.. autoclass:: CatClient
:members:
Cross-Cluster Replication (CCR)
-------------------------------
.. autoclass:: CcrClient
:members:
Cluster
-------
.. autoclass:: ClusterClient
:members:
Dangling Indices
----------------
.. autoclass:: DanglingIndicesClient
:members:
Enrich Policies
---------------
.. autoclass:: EnrichClient
:members:
Event Query Language (EQL)
--------------------------
.. autoclass:: EqlClient
:members:
Snapshottable Features
----------------------
.. autoclass:: FeaturesClient
:members:
Fleet
-----
.. autoclass:: FleetClient
:members:
Graph Explore
-------------
.. autoclass:: GraphClient
:members:
Index Lifecycle Management (ILM)
--------------------------------
.. autoclass:: IlmClient
:members:
Indices
-------
.. autoclass:: IndicesClient
:members:
Ingest Pipelines
----------------
.. autoclass:: IngestClient
:members:
License
-------
.. autoclass:: LicenseClient
:members:
Logstash
--------
.. autoclass:: LogstashClient
:members:
Migration
---------
.. autoclass:: MigrationClient
:members:
Machine Learning (ML)
---------------------
.. autoclass:: MlClient
:members:
Monitoring
----------
.. autoclass:: MonitoringClient
:members:
Nodes
-----
.. autoclass:: NodesClient
:members:
Rollup Indices
--------------
.. autoclass:: RollupClient
:members:
Searchable Snapshots
--------------------
.. autoclass:: SearchableSnapshotsClient
:members:
Security
--------
.. autoclass:: SecurityClient
:members:
Shutdown
--------
.. autoclass:: ShutdownClient
:members:
Snapshot Lifecycle Management (SLM)
-----------------------------------
.. autoclass:: SlmClient
:members:
Snapshots
---------
.. autoclass:: SnapshotClient
:members:
SQL
---
.. autoclass:: SqlClient
:members:
TLS/SSL
-------
.. autoclass:: SslClient
:members:
Tasks
-----
.. autoclass:: TasksClient
:members:
Text Structure
--------------
.. autoclass:: TextStructureClient
:members:
Transforms
----------
.. autoclass:: TransformClient
:members:
Watcher
-------
.. autoclass:: WatcherClient
:members:
-243
View File
@@ -1,243 +0,0 @@
Using Asyncio with Elasticsearch
================================
.. py:module:: elasticsearch
Starting in ``elasticsearch-py`` v7.8.0 for Python 3.6+ the ``elasticsearch`` package supports async/await with
`Asyncio <https://docs.python.org/3/library/asyncio.html>`_ and `Aiohttp <https://docs.aiohttp.org>`_.
You can either install ``aiohttp`` directly or use the ``[async]`` extra:
.. code-block:: bash
$ python -m pip install elasticsearch>=7.8.0 aiohttp
# - OR -
$ python -m pip install elasticsearch[async]>=7.8.0
.. note::
Async functionality is a new feature of this library in v7.8.0+ so
`please open an issue <https://github.com/elastic/elasticsearch-py/issues>`_
if you find an issue or have a question about async support.
Getting Started with Async
--------------------------
After installation all async API endpoints are available via :class:`~elasticsearch.AsyncElasticsearch`
and are used in the same way as other APIs, just with an extra ``await``:
.. code-block:: python
import asyncio
from elasticsearch import AsyncElasticsearch
es = AsyncElasticsearch()
async def main():
resp = await es.search(
index="documents",
body={"query": {"match_all": {}}},
size=20,
)
print(resp)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
All APIs that are available under the sync client are also available under the async client.
ASGI Applications and Elastic APM
---------------------------------
`ASGI <https://asgi.readthedocs.io>`_ (Asynchronous Server Gateway Interface) is a new way to
serve Python web applications making use of async I/O to achieve better performance.
Some examples of ASGI frameworks include FastAPI, Django 3.0+, and Starlette.
If you're using one of these frameworks along with Elasticsearch then you
should be using :py:class:`~elasticsearch.AsyncElasticsearch` to avoid blocking
the event loop with synchronous network calls for optimal performance.
`Elastic APM <https://www.elastic.co/guide/en/apm/agent/python/current/index.html>`_
also supports tracing of async Elasticsearch queries just the same as
synchronous queries. For an example on how to configure ``AsyncElasticsearch`` with
a popular ASGI framework `FastAPI <https://fastapi.tiangolo.com/>`_ and APM tracing
there is a `pre-built example <https://github.com/elastic/elasticsearch-py/tree/master/examples/fastapi-apm>`_
in the ``examples/fastapi-apm`` directory.
Frequently Asked Questions
--------------------------
NameError / ImportError when importing ``AsyncElasticsearch``?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If when trying to use ``AsyncElasticsearch`` and you're receiving a ``NameError`` or ``ImportError``
you should ensure that you're running Python 3.6+ (check with ``$ python --version``) and
that you have ``aiohttp`` installed in your environment (check with ``$ python -m pip freeze | grep aiohttp``).
If either of the above conditions is not met then async support won't be available.
What about the ``elasticsearch-async`` package?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previously asyncio was supported separately via the `elasticsearch-async <https://github.com/elastic/elasticsearch-py-async>`_
package. The ``elasticsearch-async`` package has been deprecated in favor of
``AsyncElasticsearch`` provided by the ``elasticsearch`` package
in v7.8 and onwards.
Receiving 'Unclosed client session / connector' warning?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This warning is created by ``aiohttp`` when an open HTTP connection is
garbage collected. You'll typically run into this when closing your application.
To resolve the issue ensure that :meth:`~elasticsearch.AsyncElasticsearch.close`
is called before the :py:class:`~elasticsearch.AsyncElasticsearch` instance is garbage collected.
For example if using FastAPI that might look like this:
.. code-block:: python
from fastapi import FastAPI
from elasticsearch import AsyncElasticsearch
app = FastAPI()
es = AsyncElasticsearch()
# This gets called once the app is shutting down.
@app.on_event("shutdown")
async def app_shutdown():
await es.close()
Async Helpers
-------------
Async variants of all helpers are available in ``elasticsearch.helpers``
and are all prefixed with ``async_*``. You'll notice that these APIs
are identical to the ones in the sync :ref:`helpers` documentation.
All async helpers that accept an iterator or generator also accept async iterators
and async generators.
.. py:module:: elasticsearch.helpers
Bulk and Streaming Bulk
~~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: async_bulk
.. code-block:: python
import asyncio
from elasticsearch import AsyncElasticsearch
from elasticsearch.helpers import async_bulk
es = AsyncElasticsearch()
async def gendata():
mywords = ['foo', 'bar', 'baz']
for word in mywords:
yield {
"_index": "mywords",
"doc": {"word": word},
}
async def main():
await async_bulk(es, gendata())
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
.. autofunction:: async_streaming_bulk
.. code-block:: python
import asyncio
from elasticsearch import AsyncElasticsearch
from elasticsearch.helpers import async_streaming_bulk
es = AsyncElasticsearch()
async def gendata():
mywords = ['foo', 'bar', 'baz']
for word in mywords:
yield {
"_index": "mywords",
"word": word,
}
async def main():
async for ok, result in async_streaming_bulk(es, gendata()):
action, result = result.popitem()
if not ok:
print("failed to %s document %s" % ())
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Scan
~~~~
.. autofunction:: async_scan
.. code-block:: python
import asyncio
from elasticsearch import AsyncElasticsearch
from elasticsearch.helpers import async_scan
es = AsyncElasticsearch()
async def main():
async for doc in async_scan(
client=es,
query={"query": {"match": {"title": "python"}}},
index="orders-*"
):
print(doc)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Reindex
~~~~~~~
.. autofunction:: async_reindex
API Reference
-------------
.. py:module:: elasticsearch
The API of :class:`~elasticsearch.AsyncElasticsearch` is nearly identical
to the API of :class:`~elasticsearch.Elasticsearch` with the exception that
every API call like :py:func:`~elasticsearch.AsyncElasticsearch.search` is
an ``async`` function and requires an ``await`` to properly return the response
body.
AsyncElasticsearch
~~~~~~~~~~~~~~~~~~
.. note::
To reference Elasticsearch APIs that are namespaced like ``.indices.create()``
refer to the sync API reference. These APIs are identical between sync and async.
.. autoclass:: AsyncElasticsearch
:members:
AsyncTransport
~~~~~~~~~~~~~~
.. autoclass:: AsyncTransport
:members:
AsyncConnection
~~~~~~~~~~~~~~~~~
.. autoclass:: AsyncConnection
:members:
AIOHttpConnection
~~~~~~~~~~~~~~~~~
.. autoclass:: AIOHttpConnection
:members:
-272
View File
@@ -1,272 +0,0 @@
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
#
# Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
import os
import datetime
import elasticsearch
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ["sphinx.ext.autodoc", "sphinx.ext.doctest"]
autoclass_content = "both"
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# The suffix of source filenames.
source_suffix = ".rst"
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = "index"
# General information about the project.
project = u"Elasticsearch"
copyright = u"%d, Elasticsearch B.V" % datetime.date.today().year
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
# The short X.Y version.
version = elasticsearch.__versionstr__
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]
# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}
# If false, no module index is generated.
# html_domain_indices = True
# If false, no index is generated.
# html_use_index = True
# If true, the index is split into individual pages for each letter.
# html_split_index = False
# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = "Elasticsearchdoc"
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
(
"index",
"Elasticsearch.tex",
u"Elasticsearch Documentation",
u"Honza Král",
"manual",
)
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False
# If true, show page references after internal links.
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
("index", "elasticsearch-py", u"Elasticsearch Documentation", [u"Honza Král"], 1)
]
# If true, show URL addresses after external links.
# man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
"index",
"Elasticsearch",
u"Elasticsearch Documentation",
u"Honza Král",
"Elasticsearch",
"One line description of project.",
"Miscellaneous",
)
]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []
# If false, no module index is generated.
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
-88
View File
@@ -1,88 +0,0 @@
.. _connection_api:
Connection Layer API
====================
All of the classes responsible for handling the connection to the Elasticsearch
cluster. The default subclasses used can be overridden by passing parameters to the
:class:`~elasticsearch.Elasticsearch` class. All of the arguments to the client
will be passed on to :class:`~elasticsearch.Transport`,
:class:`~elasticsearch.ConnectionPool` and :class:`~elasticsearch.Connection`.
For example if you wanted to use your own implementation of the
:class:`~elasticsearch.ConnectionSelector` class you can just pass in the
``selector_class`` parameter.
.. note::
:class:`~elasticsearch.ConnectionPool` and related options (like
``selector_class``) will only be used if more than one connection is defined.
Either directly or via the :ref:`sniffing` mechanism.
.. py:module:: elasticsearch
Transport
---------
.. autoclass:: Transport(hosts, connection_class=Urllib3HttpConnection, connection_pool_class=ConnectionPool, host_info_callback=construct_hosts_list, sniff_on_start=False, sniffer_timeout=None, sniff_on_connection_fail=False, serializer=JSONSerializer(), max_retries=3, ** kwargs)
:members:
Connection Pool
---------------
.. autoclass:: ConnectionPool(connections, dead_timeout=60, selector_class=RoundRobinSelector, randomize_hosts=True, ** kwargs)
:members:
Connection Selector
-------------------
.. autoclass:: ConnectionSelector(opts)
:members:
Urllib3HttpConnection (default connection_class)
------------------------------------------------
If you have complex SSL logic for connecting to Elasticsearch using an `SSLContext` object
might be more helpful. You can create one natively using the python SSL library with the
`create_default_context` (https://docs.python.org/3/library/ssl.html#ssl.create_default_context) method.
To create an `SSLContext` object you only need to use one of cafile, capath or cadata:
.. code-block:: python
>>> from ssl import create_default_context
>>> context = create_default_context(cafile=None, capath=None, cadata=None)
* `cafile` is the path to your CA File
* `capath` is the directory of a collection of CA's
* `cadata` is either an ASCII string of one or more PEM-encoded certificates or a bytes-like object of DER-encoded certificates.
Please note that the use of SSLContext is only available for urllib3.
.. autoclass:: Urllib3HttpConnection
:members:
API Compatibility HTTP Header
-----------------------------
The Python client can be configured to emit an HTTP header
``Accept: application/vnd.elasticsearch+json; compatible-with=7``
which signals to Elasticsearch that the client is requesting
``7.x`` version of request and response bodies. This allows for
upgrading from 7.x to 8.x version of Elasticsearch without upgrading
everything at once. Elasticsearch should be upgraded first after
the compatibility header is configured and clients should be upgraded
second.
.. code-block:: python
from elasticsearch import Elasticsearch
client = Elasticsearch("http://...", headers={"accept": "application/vnd.elasticsearch+json; compatible-with=7"})
If you'd like to have the client emit the header without configuring ``headers`` you
can use the environment variable ``ELASTIC_CLIENT_APIVERSIONING=1``.
-25
View File
@@ -1,25 +0,0 @@
.. _exceptions:
Exceptions
==========
.. py:module:: elasticsearch
.. autoclass:: ImproperlyConfigured
.. autoclass:: ElasticsearchException
.. autoclass:: SerializationError(ElasticsearchException)
.. autoclass:: TransportError(ElasticsearchException)
:members:
.. autoclass:: ConnectionError(TransportError)
.. autoclass:: ConnectionTimeout(ConnectionError)
.. autoclass:: SSLError(ConnectionError)
.. autoclass:: NotFoundError(TransportError)
.. autoclass:: ConflictError(TransportError)
.. autoclass:: RequestError(TransportError)
.. autoclass:: AuthenticationException(TransportError)
.. autoclass:: AuthorizationException(TransportError)
-137
View File
@@ -1,137 +0,0 @@
.. _helpers:
Helpers
=======
Collection of simple helper functions that abstract some specifics of the raw API.
Bulk helpers
------------
There are several helpers for the ``bulk`` API since its requirement for
specific formatting and other considerations can make it cumbersome if used directly.
All bulk helpers accept an instance of ``Elasticsearch`` class and an iterable
``actions`` (any iterable, can also be a generator, which is ideal in most
cases since it will allow you to index large datasets without the need of
loading them into memory).
The items in the ``action`` iterable should be the documents we wish to index
in several formats. The most common one is the same as returned by
:meth:`~elasticsearch.Elasticsearch.search`, for example:
.. code:: python
{
'_index': 'index-name',
'_type': 'document',
'_id': 42,
'_routing': 5,
'pipeline': 'my-ingest-pipeline',
'_source': {
"title": "Hello World!",
"body": "..."
}
}
Alternatively, if `_source` is not present, it will pop all metadata fields
from the doc and use the rest as the document data:
.. code:: python
{
"_id": 42,
"_routing": 5,
"title": "Hello World!",
"body": "..."
}
The :meth:`~elasticsearch.Elasticsearch.bulk` api accepts ``index``, ``create``,
``delete``, and ``update`` actions. Use the ``_op_type`` field to specify an
action (``_op_type`` defaults to ``index``):
.. code:: python
{
'_op_type': 'delete',
'_index': 'index-name',
'_type': 'document',
'_id': 42,
}
{
'_op_type': 'update',
'_index': 'index-name',
'_type': 'document',
'_id': 42,
'doc': {'question': 'The life, universe and everything.'}
}
Example:
~~~~~~~~
Lets say we have an iterable of data. Lets say a list of words called ``mywords``
and we want to index those words into individual documents where the structure of the
document is like ``{"word": "<myword>"}``.
.. code:: python
def gendata():
mywords = ['foo', 'bar', 'baz']
for word in mywords:
yield {
"_index": "mywords",
"word": word,
}
bulk(es, gendata())
For a more complete and complex example please take a look at
https://github.com/elastic/elasticsearch-py/blob/master/examples/bulk-ingest
The :meth:`~elasticsearch.Elasticsearch.parallel_bulk` api is a wrapper around the :meth:`~elasticsearch.Elasticsearch.bulk` api to provide threading. :meth:`~elasticsearch.Elasticsearch.parallel_bulk` returns a generator which must be consumed to produce results.
To see the results use:
.. code:: python
for success, info in parallel_bulk(...):
if not success:
print('A document failed:', info)
If you don't care about the results, you can use deque from collections:
.. code:: python
from collections import deque
deque(parallel_bulk(...), maxlen=0)
.. note::
When reading raw json strings from a file, you can also pass them in
directly (without decoding to dicts first). In that case, however, you lose
the ability to specify anything (index, type, even id) on a per-record
basis, all documents will just be sent to elasticsearch to be indexed
as-is.
.. py:module:: elasticsearch.helpers
.. autofunction:: streaming_bulk
.. autofunction:: parallel_bulk
.. autofunction:: bulk
Scan
----
.. autofunction:: scan
Reindex
-------
.. autofunction:: reindex
-451
View File
@@ -1,451 +0,0 @@
Python Elasticsearch Client
===========================
Official low-level client for Elasticsearch. Its goal is to provide common
ground for all Elasticsearch-related code in Python; because of this it tries
to be opinion-free and very extendable.
Installation
------------
Install the ``elasticsearch`` package with `pip
<https://pypi.org/project/elasticsearch>`_:
.. code-block:: console
$ python -m pip install elasticsearch
If your application uses async/await in Python you can install with
the ``async`` extra:
.. code-block:: console
$ python -m pip install elasticsearch[async]
Read more about `how to use asyncio with this project <async.html>`_.
Compatibility
-------------
The library is compatible with all Elasticsearch versions since ``0.90.x`` but you
**have to use a matching major version**:
For **Elasticsearch 7.0** and later, use the major version 7 (``7.x.y``) of the
library.
For **Elasticsearch 6.0** and later, use the major version 6 (``6.x.y``) of the
library.
For **Elasticsearch 5.0** and later, use the major version 5 (``5.x.y``) of the
library.
For **Elasticsearch 2.0** and later, use the major version 2 (``2.x.y``) of the
library, and so on.
The recommended way to set your requirements in your `setup.py` or
`requirements.txt` is:
.. code-block:: python
# Elasticsearch 7.x
elasticsearch>=7.0.0,<8.0.0
# Elasticsearch 6.x
elasticsearch>=6.0.0,<7.0.0
# Elasticsearch 5.x
elasticsearch>=5.0.0,<6.0.0
# Elasticsearch 2.x
elasticsearch>=2.0.0,<3.0.0
If you have a need to have multiple versions installed at the same time older
versions are also released as ``elasticsearch2``, ``elasticsearch5`` and ``elasticsearch6``.
Example Usage
-------------
.. code-block:: python
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
doc = {
'author': 'kimchy',
'text': 'Elasticsearch: cool. bonsai cool.',
'timestamp': datetime.now(),
}
res = es.index(index="test-index", id=1, body=doc)
print(res['result'])
res = es.get(index="test-index", id=1)
print(res['_source'])
es.indices.refresh(index="test-index")
res = es.search(index="test-index", body={"query": {"match_all": {}}})
print("Got %d Hits:" % res['hits']['total']['value'])
for hit in res['hits']['hits']:
print("%(timestamp)s %(author)s: %(text)s" % hit["_source"])
Features
--------
This client was designed as very thin wrapper around Elasticsearch's REST API to
allow for maximum flexibility. This means that there are no opinions in this
client; it also means that some of the APIs are a little cumbersome to use from
Python. We have created some :ref:`helpers` to help with this issue as well as
a more high level library (`elasticsearch-dsl`_) on top of this one to provide
a more convenient way of working with Elasticsearch.
.. _elasticsearch-dsl: https://elasticsearch-dsl.readthedocs.io/
Persistent Connections
~~~~~~~~~~~~~~~~~~~~~~
``elasticsearch-py`` uses persistent connections inside of individual connection
pools (one per each configured or sniffed node). Out of the box you can choose
between two ``http`` protocol implementations. See :ref:`transports` for more
information.
The transport layer will create an instance of the selected connection class
per node and keep track of the health of individual nodes - if a node becomes
unresponsive (throwing exceptions while connecting to it) it's put on a timeout
by the :class:`~elasticsearch.ConnectionPool` class and only returned to the
circulation after the timeout is over (or when no live nodes are left). By
default nodes are randomized before being passed into the pool and round-robin
strategy is used for load balancing.
You can customize this behavior by passing parameters to the
:ref:`connection_api` (all keyword arguments to the
:class:`~elasticsearch.Elasticsearch` class will be passed through). If what
you want to accomplish is not supported you should be able to create a subclass
of the relevant component and pass it in as a parameter to be used instead of
the default implementation.
Automatic Retries
~~~~~~~~~~~~~~~~~
If a connection to a node fails due to connection issues (raises
:class:`~elasticsearch.ConnectionError`) it is considered in faulty state. It
will be placed on hold for ``dead_timeout`` seconds and the request will be
retried on another node. If a connection fails multiple times in a row the
timeout will get progressively larger to avoid hitting a node that's, by all
indication, down. If no live connection is available, the connection that has
the smallest timeout will be used.
By default retries are not triggered by a timeout
(:class:`~elasticsearch.ConnectionTimeout`), set ``retry_on_timeout`` to
``True`` to also retry on timeouts.
.. _sniffing:
Sniffing
~~~~~~~~
The client can be configured to inspect the cluster state to get a list of
nodes upon startup, periodically and/or on failure. See
:class:`~elasticsearch.Transport` parameters for details.
Some example configurations:
.. code-block:: python
from elasticsearch import Elasticsearch
# by default we don't sniff, ever
es = Elasticsearch()
# you can specify to sniff on startup to inspect the cluster and load
# balance across all nodes
es = Elasticsearch(["seed1", "seed2"], sniff_on_start=True)
# you can also sniff periodically and/or after failure:
es = Elasticsearch(["seed1", "seed2"],
sniff_on_start=True,
sniff_on_connection_fail=True,
sniffer_timeout=60)
Thread safety
~~~~~~~~~~~~~
The client is thread safe and can be used in a multi threaded environment. Best
practice is to create a single global instance of the client and use it
throughout your application. If your application is long-running consider
turning on :ref:`sniffing` to make sure the client is up to date on the cluster
location.
By default we allow ``urllib3`` to open up to 10 connections to each node, if
your application calls for more parallelism, use the ``maxsize`` parameter to
raise the limit:
.. code-block:: python
# allow up to 25 connections to each node
es = Elasticsearch(["host1", "host2"], maxsize=25)
.. note::
Since we use persistent connections throughout the client it means that the
client doesn't tolerate ``fork`` very well. If your application calls for
multiple processes make sure you create a fresh client after call to
``fork``. Note that Python's ``multiprocessing`` module uses ``fork`` to
create new processes on POSIX systems.
TLS/SSL and Authentication
~~~~~~~~~~~~~~~~~~~~~~~~~~
You can configure the client to use ``SSL`` for connecting to your
elasticsearch cluster, including certificate verification and HTTP auth:
.. code-block:: python
from elasticsearch import Elasticsearch
# you can use RFC-1738 to specify the url
es = Elasticsearch(['https://user:secret@localhost:443'])
# ... or specify common parameters as kwargs
es = Elasticsearch(
['localhost', 'otherhost'],
http_auth=('user', 'secret'),
scheme="https",
port=443,
)
# SSL client authentication using client_cert and client_key
from ssl import create_default_context
context = create_default_context(cafile="path/to/cert.pem")
es = Elasticsearch(
['localhost', 'otherhost'],
http_auth=('user', 'secret'),
scheme="https",
port=443,
ssl_context=context,
)
.. warning::
``elasticsearch-py`` doesn't ship with default set of root certificates. To
have working SSL certificate validation you need to either specify your own
as ``cafile`` or ``capath`` or ``cadata`` or install `certifi`_ which will
be picked up automatically.
See class :class:`~elasticsearch.Urllib3HttpConnection` for detailed
description of the options.
.. _certifi: http://certifiio.readthedocs.io/en/latest/
Connecting via Cloud ID
~~~~~~~~~~~~~~~~~~~~~~~
Cloud ID is an easy way to configure your client to work
with your Elastic Cloud deployment. Combine the ``cloud_id``
with either ``http_auth`` or ``api_key`` to authenticate
with your Elastic Cloud deployment.
Using ``cloud_id`` enables TLS verification and HTTP compression by default
and sets the port to ``443`` unless otherwise overwritten via the ``port`` parameter
or the port value encoded within ``cloud_id``. Using Cloud ID also disables sniffing.
.. code-block:: python
from elasticsearch import Elasticsearch
es = Elasticsearch(
cloud_id="cluster-1:dXMa5Fx...",
http_auth=("elastic", "<password>"),
)
API Key Authentication
~~~~~~~~~~~~~~~~~~~~~~
You can configure the client to use Elasticsearch's `API Key`_ for connecting to your cluster.
Please note this authentication method has been introduced with release of Elasticsearch ``6.7.0``.
from elasticsearch import Elasticsearch
# you can use the api key tuple
es = Elasticsearch(
['node-1', 'node-2', 'node-3'],
api_key=('id', 'api_key'),
)
# or you pass the base 64 encoded token
es = Elasticsearch(
['node-1', 'node-2', 'node-3'],
api_key='base64encoded tuple',
)
.. _API Key: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
Logging
~~~~~~~
``elasticsearch-py`` uses the standard `logging library`_ from python to define
two loggers: ``elasticsearch`` and ``elasticsearch.trace``. ``elasticsearch``
is used by the client to log standard activity, depending on the log level.
``elasticsearch.trace`` can be used to log requests to the server in the form
of ``curl`` commands using pretty-printed json that can then be executed from
command line. Because it is designed to be shared (for example to demonstrate
an issue) it also just uses ``localhost:9200`` as the address instead of the
actual address of the host. If the trace logger has not been configured
already it is set to `propagate=False` so it needs to be activated separately.
.. _logging library: http://docs.python.org/3/library/logging.html
Type Hints
~~~~~~~~~~
Starting in ``elasticsearch-py`` v7.10.0 the library now ships with `type hints`_
and supports basic static type analysis with tools like `Mypy`_ and `Pyright`_.
If we write a script that has a type error like using ``request_timeout`` with
a ``str`` argument instead of ``float`` and then run Mypy on the script:
.. code-block:: python
# script.py
from elasticsearch import Elasticsearch
es = Elasticsearch(...)
es.search(
index="test-index",
request_timeout="5" # type error!
)
# $ mypy script.py
# script.py:5: error: Argument "request_timeout" to "search" of "Elasticsearch" has
# incompatible type "str"; expected "Union[int, float, None]"
# Found 1 error in 1 file (checked 1 source file)
For now many parameter types for API methods aren't specific to
a type (ie they are of type ``typing.Any``) but in the future
they will be tightened for even better static type checking.
Type hints also allow tools like your IDE to check types and provide better
auto-complete functionality.
.. warning::
The type hints for API methods like ``search`` don't match the function signature
that can be found in the source code. Type hints represent optimal usage of the
API methods. Using keyword arguments is highly recommended so all optional parameters
and ``body`` are keyword-only in type hints.
JetBrains PyCharm will use the warning ``Unexpected argument`` to denote that the
parameter may be keyword-only.
.. _type hints: https://www.python.org/dev/peps/pep-0484
.. _mypy: http://mypy-lang.org
.. _pyright: https://github.com/microsoft/pyright
Environment considerations
--------------------------
When using the client there are several limitations of your environment that
could come into play.
When using an HTTP load balancer you cannot use the :ref:`sniffing`
functionality - the cluster would supply the client with IP addresses to
directly connect to the cluster, circumventing the load balancer. Depending on
your configuration this might be something you don't want or break completely.
Compression
~~~~~~~~~~~
When using capacity-constrained networks (low throughput), it may be handy to enable
compression. This is especially useful when doing bulk loads or inserting large
documents. This will configure compression.
.. code-block:: python
from elasticsearch import Elasticsearch
es = Elasticsearch(hosts, http_compress=True)
Compression is enabled by default when connecting to Elastic Cloud via ``cloud_id``.
Customization
-------------
Custom serializers
~~~~~~~~~~~~~~~~~~
By default, `JSONSerializer`_ is used to encode all outgoing requests.
However, you can implement your own custom serializer
.. code-block:: python
from elasticsearch.serializer import JSONSerializer
class SetEncoder(JSONSerializer):
def default(self, obj):
if isinstance(obj, set):
return list(obj)
if isinstance(obj, Something):
return 'CustomSomethingRepresentation'
return JSONSerializer.default(self, obj)
es = Elasticsearch(serializer=SetEncoder())
.. _JSONSerializer: https://github.com/elastic/elasticsearch-py/blob/master/elasticsearch/serializer.py#L24
Elasticsearch-DSL
-----------------
For a more high level client library with more limited scope, have a look at
`elasticsearch-dsl`_ - a more pythonic library sitting on top of
``elasticsearch-py``.
`elasticsearch-dsl`_ provides a more convenient and idiomatic way to write and manipulate
`queries`_ by mirroring the terminology and structure of Elasticsearch JSON DSL
while exposing the whole range of the DSL from Python
either directly using defined classes or a queryset-like expressions.
It also provides an optional `persistence layer`_ for working with documents as
Python objects in an ORM-like fashion: defining mappings, retrieving and saving
documents, wrapping the document data in user-defined classes.
.. _elasticsearch-dsl: https://elasticsearch-dsl.readthedocs.io/
.. _queries: https://elasticsearch-dsl.readthedocs.io/en/latest/search_dsl.html
.. _persistence layer: https://elasticsearch-dsl.readthedocs.io/en/latest/persistence.html#doctype
Contents
--------
.. toctree::
:maxdepth: 2
api
exceptions
async
connection
transports
helpers
Release Notes <https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/release-notes.html>
License
-------
Copyright 2021 Elasticsearch B.V. Licensed under the Apache License, Version 2.0.
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
-42
View File
@@ -1,42 +0,0 @@
.. _transports:
Transport classes
=================
List of transport classes that can be used, simply import your choice and pass
it to the constructor of :class:`~elasticsearch.Elasticsearch` as
`connection_class`. Note that the
:class:`~elasticsearch.connection.RequestsHttpConnection` requires ``requests``
to be installed.
For example to use the ``requests``-based connection just import it and use it:
.. code-block:: python
from elasticsearch import Elasticsearch, RequestsHttpConnection
es = Elasticsearch(connection_class=RequestsHttpConnection)
The default connection class is based on ``urllib3`` which is more performant
and lightweight than the optional ``requests``-based class. Only use
``RequestsHttpConnection`` if you have need of any of ``requests`` advanced
features like custom auth plugins etc.
.. py:module:: elasticsearch.connection
Connection
----------
.. autoclass:: Connection
Urllib3HttpConnection
---------------------
.. autoclass:: Urllib3HttpConnection
RequestsHttpConnection
----------------------
.. autoclass:: RequestsHttpConnection
-41
View File
@@ -230,7 +230,6 @@ class AsyncElasticsearch(object):
"""
Returns whether the cluster is running.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/index.html>`_
"""
try:
return await self.transport.perform_request(
@@ -244,7 +243,6 @@ class AsyncElasticsearch(object):
"""
Returns basic information about the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/index.html>`_
"""
return await self.transport.perform_request(
"GET", "/", params=params, headers=headers
@@ -264,7 +262,6 @@ class AsyncElasticsearch(object):
Creates a new document in the index. Returns a 409 response when a document
with a same ID already exists in the index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-index_.html>`_
:arg index: The name of the index
:arg id: Document ID
@@ -319,7 +316,6 @@ class AsyncElasticsearch(object):
"""
Creates or updates a document in an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-index_.html>`_
:arg index: The name of the index
:arg body: The document
@@ -383,7 +379,6 @@ class AsyncElasticsearch(object):
"""
Allows to perform multiple index/update/delete operations in a single request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-bulk.html>`_
:arg body: The operation definition and data (action-data
pairs), separated by newlines
@@ -430,7 +425,6 @@ class AsyncElasticsearch(object):
"""
Explicitly clears the search context for a scroll.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/clear-scroll-api.html>`_
:arg body: A comma-separated list of scroll IDs to clear if none
was specified via the scroll_id parameter
@@ -469,7 +463,6 @@ class AsyncElasticsearch(object):
"""
Returns number of documents matching a query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-count.html>`_
:arg body: A query to restrict the results specified with the
Query DSL (optional)
@@ -527,7 +520,6 @@ class AsyncElasticsearch(object):
"""
Removes a document from the index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -605,7 +597,6 @@ class AsyncElasticsearch(object):
"""
Deletes documents matching the provided query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete-by-query.html>`_
:arg index: A comma-separated list of index names to search; use
`_all` or empty string to perform the operation on all indices
@@ -702,7 +693,6 @@ class AsyncElasticsearch(object):
Changes the number of requests per second for a particular Delete By Query
operation.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete-by-query.html>`_
:arg task_id: The task id to rethrottle
:arg requests_per_second: The throttle to set on this request in
@@ -723,7 +713,6 @@ class AsyncElasticsearch(object):
"""
Deletes a script.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html>`_
:arg id: Script ID
:arg master_timeout: Specify timeout for connection to master
@@ -752,7 +741,6 @@ class AsyncElasticsearch(object):
"""
Returns information about whether a document exists in an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -803,7 +791,6 @@ class AsyncElasticsearch(object):
"""
Returns information about whether a document source exists in an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -859,7 +846,6 @@ class AsyncElasticsearch(object):
"""
Returns information about why a specific matches (or doesn't match) a query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-explain.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -912,7 +898,6 @@ class AsyncElasticsearch(object):
Returns the information about the capabilities of fields among multiple
indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-field-caps.html>`_
:arg body: An index filter specified with the Query DSL
:arg index: A comma-separated list of index names; use `_all` or
@@ -953,7 +938,6 @@ class AsyncElasticsearch(object):
"""
Returns a document.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -994,7 +978,6 @@ class AsyncElasticsearch(object):
"""
Returns a script.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html>`_
:arg id: Script ID
:arg master_timeout: Specify timeout for connection to master
@@ -1021,7 +1004,6 @@ class AsyncElasticsearch(object):
"""
Returns the source of a document.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -1071,7 +1053,6 @@ class AsyncElasticsearch(object):
"""
Allows to get multiple documents in one request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-multi-get.html>`_
:arg body: Document identifiers; can be either `docs`
(containing full document information) or `ids` (when index and type is
@@ -1118,7 +1099,6 @@ class AsyncElasticsearch(object):
"""
Allows to execute several search operations in one request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-multi-search.html>`_
:arg body: The request definitions (metadata-search request
definition pairs), separated by newlines
@@ -1174,7 +1154,6 @@ class AsyncElasticsearch(object):
"""
Allows to execute several search template operations in one request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-multi-search.html>`_
:arg body: The request definitions (metadata-search request
definition pairs), separated by newlines
@@ -1226,7 +1205,6 @@ class AsyncElasticsearch(object):
"""
Returns multiple termvectors in one request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-multi-termvectors.html>`_
:arg body: Define ids, documents, parameters or a list of
parameters per document here. You must at least provide a list of
@@ -1279,7 +1257,6 @@ class AsyncElasticsearch(object):
"""
Creates or updates a script.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html>`_
:arg id: Script ID
:arg body: The document
@@ -1307,7 +1284,6 @@ class AsyncElasticsearch(object):
Allows to evaluate the quality of ranked search results over a set of typical
search queries
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-rank-eval.html>`_
.. warning::
@@ -1356,7 +1332,6 @@ class AsyncElasticsearch(object):
source documents by a query, changing the destination index settings, or
fetching the documents from a remote cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-reindex.html>`_
:arg body: The search definition using the Query DSL and the
prototype for the index request.
@@ -1392,7 +1367,6 @@ class AsyncElasticsearch(object):
"""
Changes the number of requests per second for a particular Reindex operation.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-reindex.html>`_
:arg task_id: The task id to rethrottle
:arg requests_per_second: The throttle to set on this request in
@@ -1415,7 +1389,6 @@ class AsyncElasticsearch(object):
"""
Allows to use the Mustache language to pre-render a search definition.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/render-search-template-api.html>`_
:arg body: The search definition template and its params
:arg id: The id of the stored search template
@@ -1433,7 +1406,6 @@ class AsyncElasticsearch(object):
"""
Allows an arbitrary script to be executed and a result to be returned
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html>`_
.. warning::
@@ -1455,7 +1427,6 @@ class AsyncElasticsearch(object):
"""
Allows to retrieve a large numbers of results from a single search request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-request-body.html#request-body-search-scroll>`_
:arg body: The scroll ID if not passed by URL or query
parameter.
@@ -1527,7 +1498,6 @@ class AsyncElasticsearch(object):
"""
Returns results matching a query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-search.html>`_
:arg body: The search definition using the Query DSL
:arg index: A comma-separated list of index names to search; use
@@ -1653,7 +1623,6 @@ class AsyncElasticsearch(object):
Returns information about the indices and shards that a search request would be
executed against.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-shards.html>`_
:arg index: A comma-separated list of index names to search; use
`_all` or empty string to perform the operation on all indices
@@ -1696,7 +1665,6 @@ class AsyncElasticsearch(object):
"""
Allows to use the Mustache language to pre-render a search definition.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-template.html>`_
:arg body: The search definition template and its params
:arg index: A comma-separated list of index names to search; use
@@ -1762,7 +1730,6 @@ class AsyncElasticsearch(object):
Returns information and statistics about terms in the fields of a particular
document.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-termvectors.html>`_
:arg index: The index in which the document resides.
:arg body: Define parameters and or supply a document to get
@@ -1821,7 +1788,6 @@ class AsyncElasticsearch(object):
"""
Updates a document with a script or partial document.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-update.html>`_
:arg index: The name of the index
:arg id: Document ID
@@ -1914,7 +1880,6 @@ class AsyncElasticsearch(object):
Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-update-by-query.html>`_
:arg index: A comma-separated list of index names to search; use
`_all` or empty string to perform the operation on all indices
@@ -2014,7 +1979,6 @@ class AsyncElasticsearch(object):
Changes the number of requests per second for a particular Update By Query
operation.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-update-by-query.html>`_
:arg task_id: The task id to rethrottle
:arg requests_per_second: The throttle to set on this request in
@@ -2035,7 +1999,6 @@ class AsyncElasticsearch(object):
"""
Returns all script contexts.
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html>`_
.. warning::
@@ -2051,7 +2014,6 @@ class AsyncElasticsearch(object):
"""
Returns available script types, languages and contexts
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html>`_
.. warning::
@@ -2067,7 +2029,6 @@ class AsyncElasticsearch(object):
"""
Close a point in time
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/point-in-time-api.html>`_
:arg body: a point-in-time id to close
"""
@@ -2082,7 +2043,6 @@ class AsyncElasticsearch(object):
"""
Open a point in time that can be used in subsequent searches
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/point-in-time-api.html>`_
:arg index: A comma-separated list of index names to open point
in time; use `_all` or empty string to perform the operation on all
@@ -2108,7 +2068,6 @@ class AsyncElasticsearch(object):
the provided string. It is designed for low-latency look-ups used in auto-
complete scenarios.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-terms-enum.html>`_
.. warning::
-25
View File
@@ -34,7 +34,6 @@ class CatClient(NamespacedClient):
Shows information about currently configured aliases to indices including
filter and routing infos.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-alias.html>`_
:arg name: A comma-separated list of alias names to return
:arg expand_wildcards: Whether to expand wildcard expression to
@@ -60,7 +59,6 @@ class CatClient(NamespacedClient):
Provides a snapshot of how many shards are allocated to each data node and how
much disk space they are using.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-allocation.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information
@@ -91,7 +89,6 @@ class CatClient(NamespacedClient):
Provides quick access to the document count of the entire cluster, or
individual indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-count.html>`_
:arg index: A comma-separated list of index names to limit the
returned information
@@ -112,7 +109,6 @@ class CatClient(NamespacedClient):
"""
Returns a concise representation of the cluster health.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-health.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -134,7 +130,6 @@ class CatClient(NamespacedClient):
"""
Returns help for the Cat APIs.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat.html>`_
:arg help: Return help information
:arg s: Comma-separated list of column names or column aliases
@@ -164,7 +159,6 @@ class CatClient(NamespacedClient):
Returns information about indices: number of primaries and replicas, document
counts, disk size, ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-indices.html>`_
:arg index: A comma-separated list of index names to limit the
returned information
@@ -203,7 +197,6 @@ class CatClient(NamespacedClient):
"""
Returns information about the master node.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-master.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -238,7 +231,6 @@ class CatClient(NamespacedClient):
"""
Returns basic statistics about performance of cluster nodes.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-nodes.html>`_
:arg bytes: The unit in which to display byte values Valid
choices: b, k, kb, m, mb, g, gb, t, tb, p, pb
@@ -272,7 +264,6 @@ class CatClient(NamespacedClient):
"""
Returns information about index shard recoveries, both on-going completed.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-recovery.html>`_
:arg index: Comma-separated list or wildcard expression of index
names to limit the returned information
@@ -303,7 +294,6 @@ class CatClient(NamespacedClient):
"""
Provides a detailed view of shard allocation on nodes.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-shards.html>`_
:arg index: A comma-separated list of index names to limit the
returned information
@@ -332,7 +322,6 @@ class CatClient(NamespacedClient):
"""
Provides low-level information about the segments in the shards of an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-segments.html>`_
:arg index: A comma-separated list of index names to limit the
returned information
@@ -355,7 +344,6 @@ class CatClient(NamespacedClient):
"""
Returns a concise representation of the cluster pending tasks.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-pending-tasks.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -381,7 +369,6 @@ class CatClient(NamespacedClient):
Returns cluster-wide thread pool statistics per node. By default the active,
queue and rejected statistics are returned for all thread pools.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-thread-pool.html>`_
:arg thread_pool_patterns: A comma-separated list of regular-
expressions to filter the thread pools in the output
@@ -412,7 +399,6 @@ class CatClient(NamespacedClient):
Shows how much heap memory is currently being used by fielddata on every data
node in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-fielddata.html>`_
:arg fields: A comma-separated list of fields to return in the
output
@@ -440,7 +426,6 @@ class CatClient(NamespacedClient):
"""
Returns information about installed plugins across nodes node.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-plugins.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -465,7 +450,6 @@ class CatClient(NamespacedClient):
"""
Returns information about custom node attributes.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-nodeattrs.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -488,7 +472,6 @@ class CatClient(NamespacedClient):
"""
Returns information about snapshot repositories registered in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-repositories.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -513,7 +496,6 @@ class CatClient(NamespacedClient):
"""
Returns all snapshots in a specific repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-snapshots.html>`_
:arg repository: Name of repository from which to fetch the
snapshot information
@@ -555,7 +537,6 @@ class CatClient(NamespacedClient):
Returns information about the tasks currently executing on one or more nodes in
the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html>`_
:arg actions: A comma-separated list of actions that should be
returned. Leave empty to return all.
@@ -584,7 +565,6 @@ class CatClient(NamespacedClient):
"""
Returns information about existing templates.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-templates.html>`_
:arg name: A pattern that returned template names must match
:arg format: a short version of the Accept header, e.g. json,
@@ -608,7 +588,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about data frame analytics jobs.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-dfanalytics.html>`_
:arg id: The ID of the data frame analytics to fetch
:arg allow_no_match: Whether to ignore if a wildcard expression
@@ -640,7 +619,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about datafeeds.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-datafeeds.html>`_
:arg datafeed_id: The ID of the datafeeds stats to fetch
:arg allow_no_datafeeds: Whether to ignore if a wildcard
@@ -681,7 +659,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about anomaly detection jobs.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-anomaly-detectors.html>`_
:arg job_id: The ID of the jobs stats to fetch
:arg allow_no_jobs: Whether to ignore if a wildcard expression
@@ -725,7 +702,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about inference trained models.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-trained-model.html>`_
:arg model_id: The ID of the trained models stats to fetch
:arg allow_no_match: Whether to ignore if a wildcard expression
@@ -764,7 +740,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about transforms.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-transforms.html>`_
:arg transform_id: The id of the transform for which to get
stats. '_all' or '*' implies all transforms
-15
View File
@@ -45,7 +45,6 @@ class ClusterClient(NamespacedClient):
"""
Returns basic information about the health of the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-health.html>`_
:arg index: Limit the information returned to a specific index
:arg expand_wildcards: Whether to expand wildcard expression to
@@ -85,7 +84,6 @@ class ClusterClient(NamespacedClient):
Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-pending.html>`_
:arg local: Return local information, do not retrieve the state
from master node (default: false)
@@ -109,7 +107,6 @@ class ClusterClient(NamespacedClient):
"""
Returns a comprehensive information about the state of the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-state.html>`_
:arg metric: Limit the information returned to the specified
metrics Valid choices: _all, blocks, metadata, nodes, routing_table,
@@ -149,7 +146,6 @@ class ClusterClient(NamespacedClient):
"""
Returns high-level overview of cluster statistics.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-stats.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
@@ -175,7 +171,6 @@ class ClusterClient(NamespacedClient):
"""
Allows to manually change the allocation of individual shards in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-reroute.html>`_
:arg body: The definition of `commands` to perform (`move`,
`cancel`, `allocate`)
@@ -201,7 +196,6 @@ class ClusterClient(NamespacedClient):
"""
Returns cluster settings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-get-settings.html>`_
:arg flat_settings: Return settings in flat format (default:
false)
@@ -220,7 +214,6 @@ class ClusterClient(NamespacedClient):
"""
Updates the cluster settings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-update-settings.html>`_
:arg body: The settings to be updated. Can be either `transient`
or `persistent` (survives cluster restart).
@@ -242,7 +235,6 @@ class ClusterClient(NamespacedClient):
"""
Returns the information about configured remote clusters.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-remote-info.html>`_
"""
return await self.transport.perform_request(
"GET", "/_remote/info", params=params, headers=headers
@@ -253,7 +245,6 @@ class ClusterClient(NamespacedClient):
"""
Provides explanations for shard allocations in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-allocation-explain.html>`_
:arg body: The index, shard, and primary flag to explain. Empty
means 'explain the first unassigned shard'
@@ -275,7 +266,6 @@ class ClusterClient(NamespacedClient):
"""
Deletes a component template
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-component-template.html>`_
:arg name: The name of the template
:arg master_timeout: Specify timeout for connection to master
@@ -296,7 +286,6 @@ class ClusterClient(NamespacedClient):
"""
Returns one or more component templates
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-component-template.html>`_
:arg name: The comma separated names of the component templates
:arg local: Return local information, do not retrieve the state
@@ -316,7 +305,6 @@ class ClusterClient(NamespacedClient):
"""
Creates or updates a component template
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-component-template.html>`_
:arg name: The name of the template
:arg body: The template definition
@@ -342,7 +330,6 @@ class ClusterClient(NamespacedClient):
"""
Returns information about whether a particular component template exist
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-component-template.html>`_
:arg name: The name of the template
:arg local: Return local information, do not retrieve the state
@@ -365,7 +352,6 @@ class ClusterClient(NamespacedClient):
"""
Clears cluster voting config exclusions.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/voting-config-exclusions.html>`_
:arg wait_for_removal: Specifies whether to wait for all
excluded nodes to be removed from the cluster before clearing the voting
@@ -383,7 +369,6 @@ class ClusterClient(NamespacedClient):
"""
Updates the cluster voting config exclusions by node ids or node names.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/voting-config-exclusions.html>`_
:arg node_ids: A comma-separated list of the persistent ids of
the nodes to exclude from the voting configuration. If specified, you
@@ -33,7 +33,6 @@ class DanglingIndicesClient(NamespacedClient):
"""
Deletes the specified dangling index
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-gateway-dangling-indices.html>`_
:arg index_uuid: The UUID of the dangling index
:arg accept_data_loss: Must be set to true in order to delete
@@ -56,7 +55,6 @@ class DanglingIndicesClient(NamespacedClient):
"""
Imports the specified dangling index
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-gateway-dangling-indices.html>`_
:arg index_uuid: The UUID of the dangling index
:arg accept_data_loss: Must be set to true in order to import
@@ -76,7 +74,6 @@ class DanglingIndicesClient(NamespacedClient):
"""
Returns all dangling indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-gateway-dangling-indices.html>`_
"""
return await self.transport.perform_request(
"GET", "/_dangling", params=params, headers=headers
-2
View File
@@ -34,7 +34,6 @@ class FeaturesClient(NamespacedClient):
Gets a list of features which can be included in snapshots using the
feature_states field when creating a snapshot
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-features-api.html>`_
:arg master_timeout: Explicit operation timeout for connection
to master node
@@ -48,7 +47,6 @@ class FeaturesClient(NamespacedClient):
"""
Resets the internal state of features, usually by deleting system indices
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
.. warning::
-57
View File
@@ -34,7 +34,6 @@ class IndicesClient(NamespacedClient):
Performs the analysis process on a text and return the tokens breakdown of the
text.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-analyze.html>`_
:arg body: Define analyzer/tokenizer parameters and the text on
which the analysis should be performed
@@ -53,7 +52,6 @@ class IndicesClient(NamespacedClient):
"""
Performs the refresh operation in one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-refresh.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -81,7 +79,6 @@ class IndicesClient(NamespacedClient):
"""
Performs the flush operation on one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-flush.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string for all indices
@@ -114,7 +111,6 @@ class IndicesClient(NamespacedClient):
"""
Creates an index with optional settings and mappings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-create-index.html>`_
:arg index: The name of the index
:arg body: The configuration for the index (`settings` and
@@ -138,7 +134,6 @@ class IndicesClient(NamespacedClient):
"""
Clones an index
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-clone-index.html>`_
:arg index: The name of the source index to clone
:arg target: The name of the target index to clone into
@@ -175,7 +170,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-index.html>`_
:arg index: A comma-separated list of index names
:arg allow_no_indices: Ignore if a wildcard expression resolves
@@ -214,7 +208,6 @@ class IndicesClient(NamespacedClient):
"""
Opens an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-open-close.html>`_
:arg index: A comma separated list of indices to open
:arg allow_no_indices: Whether to ignore if a wildcard indices
@@ -249,7 +242,6 @@ class IndicesClient(NamespacedClient):
"""
Closes an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-open-close.html>`_
:arg index: A comma separated list of indices to close
:arg allow_no_indices: Whether to ignore if a wildcard indices
@@ -285,7 +277,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-delete-index.html>`_
:arg index: A comma-separated list of indices to delete; use
`_all` or `*` string to delete all indices
@@ -318,7 +309,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about whether a particular index exists.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-exists.html>`_
:arg index: A comma-separated list of index names
:arg allow_no_indices: Ignore if a wildcard expression resolves
@@ -348,7 +338,6 @@ class IndicesClient(NamespacedClient):
Returns information about whether a particular document type exists.
(DEPRECATED)
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-types-exists.html>`_
:arg index: A comma-separated list of index names; use `_all` to
check the types across all indices
@@ -390,7 +379,6 @@ class IndicesClient(NamespacedClient):
"""
Updates the index mappings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-put-mapping.html>`_
:arg body: The mapping definition
:arg index: A comma-separated list of index names the mapping
@@ -438,7 +426,6 @@ class IndicesClient(NamespacedClient):
"""
Returns mappings for one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-mapping.html>`_
:arg index: A comma-separated list of index names
:arg doc_type: A comma-separated list of document types
@@ -477,7 +464,6 @@ class IndicesClient(NamespacedClient):
"""
Returns mapping for one or more fields.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-field-mapping.html>`_
:arg fields: A comma-separated list of fields
:arg index: A comma-separated list of index names
@@ -512,7 +498,6 @@ class IndicesClient(NamespacedClient):
"""
Creates or updates an alias.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg index: A comma-separated list of index names the alias
should point to (supports wildcards); use `_all` to perform the
@@ -540,7 +525,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about whether a particular alias exists.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg name: A comma-separated list of alias names to return
:arg index: A comma-separated list of index names to filter
@@ -568,7 +552,6 @@ class IndicesClient(NamespacedClient):
"""
Returns an alias.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg index: A comma-separated list of index names to filter
aliases
@@ -593,7 +576,6 @@ class IndicesClient(NamespacedClient):
"""
Updates index aliases.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg body: The definition of `actions` to perform
:arg master_timeout: Specify timeout for connection to master
@@ -611,7 +593,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes an alias.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg index: A comma-separated list of index names (supports
wildcards); use `_all` for all indices
@@ -633,7 +614,6 @@ class IndicesClient(NamespacedClient):
"""
Creates or updates an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg body: The template definition
@@ -663,7 +643,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about whether a particular index template exists.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The comma separated names of the index templates
:arg flat_settings: Return settings in flat format (default:
@@ -685,7 +664,6 @@ class IndicesClient(NamespacedClient):
"""
Returns an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The comma separated names of the index templates
:arg flat_settings: Return settings in flat format (default:
@@ -706,7 +684,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg master_timeout: Specify timeout for connection to master
@@ -732,7 +709,6 @@ class IndicesClient(NamespacedClient):
"""
Returns settings for one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-settings.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -770,7 +746,6 @@ class IndicesClient(NamespacedClient):
"""
Updates the index settings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-update-settings.html>`_
:arg body: The index settings to be updated
:arg index: A comma-separated list of index names; use `_all` or
@@ -818,7 +793,6 @@ class IndicesClient(NamespacedClient):
"""
Provides statistics on operations happening in an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-stats.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -862,7 +836,6 @@ class IndicesClient(NamespacedClient):
"""
Provides low-level information about segments in a Lucene index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-segments.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -900,7 +873,6 @@ class IndicesClient(NamespacedClient):
"""
Allows a user to validate a potentially expensive query without executing it.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-validate.html>`_
:arg body: The query definition specified with the Query DSL
:arg index: A comma-separated list of index names to restrict
@@ -954,7 +926,6 @@ class IndicesClient(NamespacedClient):
"""
Clears all or specific caches for one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-clearcache.html>`_
:arg index: A comma-separated list of index name to limit the
operation
@@ -981,7 +952,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about ongoing index shard recoveries.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-recovery.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1005,7 +975,6 @@ class IndicesClient(NamespacedClient):
"""
DEPRECATED Upgrades to the current version of Lucene.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1031,7 +1000,6 @@ class IndicesClient(NamespacedClient):
"""
DEPRECATED Returns a progress status of current upgrade.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1054,7 +1022,6 @@ class IndicesClient(NamespacedClient):
Performs a synced flush operation on one or more indices. Synced flush is
deprecated and will be removed in 8.0. Use flush instead
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-synced-flush-api.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string for all indices
@@ -1081,7 +1048,6 @@ class IndicesClient(NamespacedClient):
"""
Provides store information for shard copies of indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-shards-stores.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1113,7 +1079,6 @@ class IndicesClient(NamespacedClient):
"""
Performs the force merge operation on one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-forcemerge.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1143,7 +1108,6 @@ class IndicesClient(NamespacedClient):
"""
Allow to shrink an existing index into a new index with fewer primary shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-shrink-index.html>`_
:arg index: The name of the source index to shrink
:arg target: The name of the target index to shrink into
@@ -1176,7 +1140,6 @@ class IndicesClient(NamespacedClient):
Allows you to split an existing index into a new index with more primary
shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-split-index.html>`_
:arg index: The name of the source index to split
:arg target: The name of the target index to split into
@@ -1215,7 +1178,6 @@ class IndicesClient(NamespacedClient):
Updates an alias to point to a new index when the existing index is considered
to be too large or too old.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-rollover-index.html>`_
:arg alias: The name of the alias to rollover
:arg body: The conditions that needs to be met for executing
@@ -1256,7 +1218,6 @@ class IndicesClient(NamespacedClient):
Freezes an index. A frozen index has almost no overhead on the cluster (except
for maintaining its metadata in memory) and is read-only.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/freeze-index-api.html>`_
:arg index: The name of the index to freeze
:arg allow_no_indices: Whether to ignore if a wildcard indices
@@ -1292,7 +1253,6 @@ class IndicesClient(NamespacedClient):
Unfreezes an index. When a frozen index is unfrozen, the index goes through the
normal recovery process and becomes writeable again.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/unfreeze-index-api.html>`_
:arg index: The name of the index to unfreeze
:arg allow_no_indices: Whether to ignore if a wildcard indices
@@ -1320,7 +1280,6 @@ class IndicesClient(NamespacedClient):
"""
Reloads an index's search analyzers and their resources.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-reload-analyzers.html>`_
:arg index: A comma-separated list of index names to reload
analyzers for
@@ -1348,7 +1307,6 @@ class IndicesClient(NamespacedClient):
"""
Creates a data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: The name of the data stream
"""
@@ -1364,7 +1322,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes a data stream.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: A comma-separated list of data streams to delete; use
`*` to delete all data streams
@@ -1384,7 +1341,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg master_timeout: Specify timeout for connection to master
@@ -1405,7 +1361,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about whether a particular index template exists.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg flat_settings: Return settings in flat format (default:
@@ -1427,7 +1382,6 @@ class IndicesClient(NamespacedClient):
"""
Returns an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The comma separated names of the index templates
:arg flat_settings: Return settings in flat format (default:
@@ -1446,7 +1400,6 @@ class IndicesClient(NamespacedClient):
"""
Creates or updates an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg body: The template definition
@@ -1474,7 +1427,6 @@ class IndicesClient(NamespacedClient):
Simulate matching the given index name against the index templates in the
system
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the index (it must be a concrete index
name)
@@ -1503,7 +1455,6 @@ class IndicesClient(NamespacedClient):
"""
Returns data streams.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: A comma-separated list of data streams to get; use
`*` to get all data streams
@@ -1520,7 +1471,6 @@ class IndicesClient(NamespacedClient):
"""
Simulate resolving the given template name or body
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg body: New index template definition to be simulated, if no
index template name is specified
@@ -1545,7 +1495,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about any matching indices, aliases, and data streams
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-resolve-index-api.html>`_
.. warning::
@@ -1576,7 +1525,6 @@ class IndicesClient(NamespacedClient):
"""
Adds a block to an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/index-modules-blocks.html>`_
:arg index: A comma separated list of indices to add a block to
:arg block: The block to add (one of read, write, read_only or
@@ -1605,7 +1553,6 @@ class IndicesClient(NamespacedClient):
"""
Provides statistics on operations happening in a data stream.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: A comma-separated list of data stream names; use
`_all` or empty string to perform the operation on all data streams
@@ -1623,7 +1570,6 @@ class IndicesClient(NamespacedClient):
Promotes a data stream from a replicated data stream managed by CCR to a
regular data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: The name of the data stream
"""
@@ -1642,7 +1588,6 @@ class IndicesClient(NamespacedClient):
"""
Migrates an alias to a data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: The name of the alias to migrate
"""
@@ -1667,7 +1612,6 @@ class IndicesClient(NamespacedClient):
"""
Analyzes the disk usage of each field of an index or data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-disk-usage.html>`_
.. warning::
@@ -1703,7 +1647,6 @@ class IndicesClient(NamespacedClient):
"""
Returns the field usage stats for each field of an index
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html>`_
.. warning::
-6
View File
@@ -33,7 +33,6 @@ class IngestClient(NamespacedClient):
"""
Returns a pipeline.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-pipeline-api.html>`_
:arg id: Comma separated list of pipeline ids. Wildcards
supported
@@ -51,7 +50,6 @@ class IngestClient(NamespacedClient):
"""
Creates or updates a pipeline.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-pipeline-api.html>`_
:arg id: Pipeline ID
:arg body: The ingest definition
@@ -76,7 +74,6 @@ class IngestClient(NamespacedClient):
"""
Deletes a pipeline.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-pipeline-api.html>`_
:arg id: Pipeline ID
:arg master_timeout: Explicit operation timeout for connection
@@ -98,7 +95,6 @@ class IngestClient(NamespacedClient):
"""
Allows to simulate a pipeline with example documents.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/simulate-pipeline-api.html>`_
:arg body: The simulate definition
:arg id: Pipeline ID
@@ -121,7 +117,6 @@ class IngestClient(NamespacedClient):
"""
Returns a list of the built-in patterns.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/grok-processor.html#grok-processor-rest-get>`_
"""
return await self.transport.perform_request(
"GET", "/_ingest/processor/grok", params=params, headers=headers
@@ -132,7 +127,6 @@ class IngestClient(NamespacedClient):
"""
Returns statistical information about geoip databases
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/geoip-stats-api.html>`_
"""
return await self.transport.perform_request(
"GET", "/_ingest/geoip/stats", params=params, headers=headers
-5
View File
@@ -35,7 +35,6 @@ class NodesClient(NamespacedClient):
"""
Reloads secure settings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/secure-settings.html#reloadable-secure-settings>`_
:arg body: An object containing the password for the
elasticsearch keystore
@@ -57,7 +56,6 @@ class NodesClient(NamespacedClient):
"""
Returns information about nodes in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-info.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
@@ -91,7 +89,6 @@ class NodesClient(NamespacedClient):
"""
Returns statistical information about nodes in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-stats.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
@@ -139,7 +136,6 @@ class NodesClient(NamespacedClient):
"""
Returns information about hot threads on each node in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-hot-threads.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
@@ -173,7 +169,6 @@ class NodesClient(NamespacedClient):
"""
Returns low-level information about REST actions usage on nodes.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-usage.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
-3
View File
@@ -30,9 +30,6 @@ from .utils import NamespacedClient, query_params
class RemoteClient(NamespacedClient):
@query_params()
async def info(self, params=None, headers=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-remote-info.html>`_
"""
return await self.transport.perform_request(
"GET", "/_remote/info", params=params, headers=headers
)
-12
View File
@@ -33,7 +33,6 @@ class SnapshotClient(NamespacedClient):
"""
Creates a snapshot in a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A snapshot name
@@ -60,7 +59,6 @@ class SnapshotClient(NamespacedClient):
"""
Deletes a snapshot.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A snapshot name
@@ -89,7 +87,6 @@ class SnapshotClient(NamespacedClient):
"""
Returns information about a snapshot.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
@@ -121,7 +118,6 @@ class SnapshotClient(NamespacedClient):
"""
Deletes a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: Name of the snapshot repository to unregister.
Wildcard (`*`) patterns are supported.
@@ -144,7 +140,6 @@ class SnapshotClient(NamespacedClient):
"""
Returns information about a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A comma-separated list of repository names
:arg local: Return local information, do not retrieve the state
@@ -161,7 +156,6 @@ class SnapshotClient(NamespacedClient):
"""
Creates a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg body: The repository definition
@@ -187,7 +181,6 @@ class SnapshotClient(NamespacedClient):
"""
Restores a snapshot.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A snapshot name
@@ -214,7 +207,6 @@ class SnapshotClient(NamespacedClient):
"""
Returns information about the status of a snapshot.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
@@ -236,7 +228,6 @@ class SnapshotClient(NamespacedClient):
"""
Verifies a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg master_timeout: Explicit operation timeout for connection
@@ -258,7 +249,6 @@ class SnapshotClient(NamespacedClient):
"""
Removes stale data from repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/clean-up-snapshot-repo-api.html>`_
:arg repository: A repository name
:arg master_timeout: Explicit operation timeout for connection
@@ -282,7 +272,6 @@ class SnapshotClient(NamespacedClient):
"""
Clones indices from one snapshot into another snapshot in the same repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: The name of the snapshot to clone from
@@ -320,7 +309,6 @@ class SnapshotClient(NamespacedClient):
"""
Analyzes a repository for correctness and performance
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg blob_count: Number of blobs to create during the test.
-3
View File
@@ -43,7 +43,6 @@ class TasksClient(NamespacedClient):
"""
Returns a list of tasks.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html>`_
.. warning::
@@ -73,7 +72,6 @@ class TasksClient(NamespacedClient):
"""
Cancels a task, if it can be cancelled through an API.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html>`_
.. warning::
@@ -105,7 +103,6 @@ class TasksClient(NamespacedClient):
"""
Returns information about a task.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html>`_
.. warning::
-41
View File
@@ -230,7 +230,6 @@ class Elasticsearch(object):
"""
Returns whether the cluster is running.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/index.html>`_
"""
try:
return self.transport.perform_request(
@@ -244,7 +243,6 @@ class Elasticsearch(object):
"""
Returns basic information about the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/index.html>`_
"""
return self.transport.perform_request(
"GET", "/", params=params, headers=headers
@@ -264,7 +262,6 @@ class Elasticsearch(object):
Creates a new document in the index. Returns a 409 response when a document
with a same ID already exists in the index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-index_.html>`_
:arg index: The name of the index
:arg id: Document ID
@@ -317,7 +314,6 @@ class Elasticsearch(object):
"""
Creates or updates a document in an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-index_.html>`_
:arg index: The name of the index
:arg body: The document
@@ -381,7 +377,6 @@ class Elasticsearch(object):
"""
Allows to perform multiple index/update/delete operations in a single request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-bulk.html>`_
:arg body: The operation definition and data (action-data
pairs), separated by newlines
@@ -428,7 +423,6 @@ class Elasticsearch(object):
"""
Explicitly clears the search context for a scroll.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/clear-scroll-api.html>`_
:arg body: A comma-separated list of scroll IDs to clear if none
was specified via the scroll_id parameter
@@ -465,7 +459,6 @@ class Elasticsearch(object):
"""
Returns number of documents matching a query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-count.html>`_
:arg body: A query to restrict the results specified with the
Query DSL (optional)
@@ -523,7 +516,6 @@ class Elasticsearch(object):
"""
Removes a document from the index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -599,7 +591,6 @@ class Elasticsearch(object):
"""
Deletes documents matching the provided query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete-by-query.html>`_
:arg index: A comma-separated list of index names to search; use
`_all` or empty string to perform the operation on all indices
@@ -696,7 +687,6 @@ class Elasticsearch(object):
Changes the number of requests per second for a particular Delete By Query
operation.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete-by-query.html>`_
:arg task_id: The task id to rethrottle
:arg requests_per_second: The throttle to set on this request in
@@ -717,7 +707,6 @@ class Elasticsearch(object):
"""
Deletes a script.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html>`_
:arg id: Script ID
:arg master_timeout: Specify timeout for connection to master
@@ -746,7 +735,6 @@ class Elasticsearch(object):
"""
Returns information about whether a document exists in an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -797,7 +785,6 @@ class Elasticsearch(object):
"""
Returns information about whether a document source exists in an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -851,7 +838,6 @@ class Elasticsearch(object):
"""
Returns information about why a specific matches (or doesn't match) a query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-explain.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -904,7 +890,6 @@ class Elasticsearch(object):
Returns the information about the capabilities of fields among multiple
indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-field-caps.html>`_
:arg body: An index filter specified with the Query DSL
:arg index: A comma-separated list of index names; use `_all` or
@@ -945,7 +930,6 @@ class Elasticsearch(object):
"""
Returns a document.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -986,7 +970,6 @@ class Elasticsearch(object):
"""
Returns a script.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html>`_
:arg id: Script ID
:arg master_timeout: Specify timeout for connection to master
@@ -1013,7 +996,6 @@ class Elasticsearch(object):
"""
Returns the source of a document.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html>`_
:arg index: The name of the index
:arg id: The document ID
@@ -1063,7 +1045,6 @@ class Elasticsearch(object):
"""
Allows to get multiple documents in one request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-multi-get.html>`_
:arg body: Document identifiers; can be either `docs`
(containing full document information) or `ids` (when index and type is
@@ -1110,7 +1091,6 @@ class Elasticsearch(object):
"""
Allows to execute several search operations in one request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-multi-search.html>`_
:arg body: The request definitions (metadata-search request
definition pairs), separated by newlines
@@ -1166,7 +1146,6 @@ class Elasticsearch(object):
"""
Allows to execute several search template operations in one request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-multi-search.html>`_
:arg body: The request definitions (metadata-search request
definition pairs), separated by newlines
@@ -1218,7 +1197,6 @@ class Elasticsearch(object):
"""
Returns multiple termvectors in one request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-multi-termvectors.html>`_
:arg body: Define ids, documents, parameters or a list of
parameters per document here. You must at least provide a list of
@@ -1271,7 +1249,6 @@ class Elasticsearch(object):
"""
Creates or updates a script.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html>`_
:arg id: Script ID
:arg body: The document
@@ -1299,7 +1276,6 @@ class Elasticsearch(object):
Allows to evaluate the quality of ranked search results over a set of typical
search queries
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-rank-eval.html>`_
.. warning::
@@ -1348,7 +1324,6 @@ class Elasticsearch(object):
source documents by a query, changing the destination index settings, or
fetching the documents from a remote cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-reindex.html>`_
:arg body: The search definition using the Query DSL and the
prototype for the index request.
@@ -1384,7 +1359,6 @@ class Elasticsearch(object):
"""
Changes the number of requests per second for a particular Reindex operation.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-reindex.html>`_
:arg task_id: The task id to rethrottle
:arg requests_per_second: The throttle to set on this request in
@@ -1405,7 +1379,6 @@ class Elasticsearch(object):
"""
Allows to use the Mustache language to pre-render a search definition.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/render-search-template-api.html>`_
:arg body: The search definition template and its params
:arg id: The id of the stored search template
@@ -1423,7 +1396,6 @@ class Elasticsearch(object):
"""
Allows an arbitrary script to be executed and a result to be returned
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html>`_
.. warning::
@@ -1445,7 +1417,6 @@ class Elasticsearch(object):
"""
Allows to retrieve a large numbers of results from a single search request.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-request-body.html#request-body-search-scroll>`_
:arg body: The scroll ID if not passed by URL or query
parameter.
@@ -1515,7 +1486,6 @@ class Elasticsearch(object):
"""
Returns results matching a query.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-search.html>`_
:arg body: The search definition using the Query DSL
:arg index: A comma-separated list of index names to search; use
@@ -1641,7 +1611,6 @@ class Elasticsearch(object):
Returns information about the indices and shards that a search request would be
executed against.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-shards.html>`_
:arg index: A comma-separated list of index names to search; use
`_all` or empty string to perform the operation on all indices
@@ -1684,7 +1653,6 @@ class Elasticsearch(object):
"""
Allows to use the Mustache language to pre-render a search definition.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-template.html>`_
:arg body: The search definition template and its params
:arg index: A comma-separated list of index names to search; use
@@ -1750,7 +1718,6 @@ class Elasticsearch(object):
Returns information and statistics about terms in the fields of a particular
document.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-termvectors.html>`_
:arg index: The index in which the document resides.
:arg body: Define parameters and or supply a document to get
@@ -1809,7 +1776,6 @@ class Elasticsearch(object):
"""
Updates a document with a script or partial document.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-update.html>`_
:arg index: The name of the index
:arg id: Document ID
@@ -1902,7 +1868,6 @@ class Elasticsearch(object):
Performs an update on every document in the index without changing the source,
for example to pick up a mapping change.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-update-by-query.html>`_
:arg index: A comma-separated list of index names to search; use
`_all` or empty string to perform the operation on all indices
@@ -2002,7 +1967,6 @@ class Elasticsearch(object):
Changes the number of requests per second for a particular Update By Query
operation.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-update-by-query.html>`_
:arg task_id: The task id to rethrottle
:arg requests_per_second: The throttle to set on this request in
@@ -2023,7 +1987,6 @@ class Elasticsearch(object):
"""
Returns all script contexts.
`<https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html>`_
.. warning::
@@ -2039,7 +2002,6 @@ class Elasticsearch(object):
"""
Returns available script types, languages and contexts
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html>`_
.. warning::
@@ -2055,7 +2017,6 @@ class Elasticsearch(object):
"""
Close a point in time
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/point-in-time-api.html>`_
:arg body: a point-in-time id to close
"""
@@ -2070,7 +2031,6 @@ class Elasticsearch(object):
"""
Open a point in time that can be used in subsequent searches
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/point-in-time-api.html>`_
:arg index: A comma-separated list of index names to open point
in time; use `_all` or empty string to perform the operation on all
@@ -2096,7 +2056,6 @@ class Elasticsearch(object):
the provided string. It is designed for low-latency look-ups used in auto-
complete scenarios.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-terms-enum.html>`_
.. warning::
-25
View File
@@ -34,7 +34,6 @@ class CatClient(NamespacedClient):
Shows information about currently configured aliases to indices including
filter and routing infos.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-alias.html>`_
:arg name: A comma-separated list of alias names to return
:arg expand_wildcards: Whether to expand wildcard expression to
@@ -60,7 +59,6 @@ class CatClient(NamespacedClient):
Provides a snapshot of how many shards are allocated to each data node and how
much disk space they are using.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-allocation.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information
@@ -91,7 +89,6 @@ class CatClient(NamespacedClient):
Provides quick access to the document count of the entire cluster, or
individual indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-count.html>`_
:arg index: A comma-separated list of index names to limit the
returned information
@@ -112,7 +109,6 @@ class CatClient(NamespacedClient):
"""
Returns a concise representation of the cluster health.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-health.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -134,7 +130,6 @@ class CatClient(NamespacedClient):
"""
Returns help for the Cat APIs.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat.html>`_
:arg help: Return help information
:arg s: Comma-separated list of column names or column aliases
@@ -164,7 +159,6 @@ class CatClient(NamespacedClient):
Returns information about indices: number of primaries and replicas, document
counts, disk size, ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-indices.html>`_
:arg index: A comma-separated list of index names to limit the
returned information
@@ -203,7 +197,6 @@ class CatClient(NamespacedClient):
"""
Returns information about the master node.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-master.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -238,7 +231,6 @@ class CatClient(NamespacedClient):
"""
Returns basic statistics about performance of cluster nodes.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-nodes.html>`_
:arg bytes: The unit in which to display byte values Valid
choices: b, k, kb, m, mb, g, gb, t, tb, p, pb
@@ -272,7 +264,6 @@ class CatClient(NamespacedClient):
"""
Returns information about index shard recoveries, both on-going completed.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-recovery.html>`_
:arg index: Comma-separated list or wildcard expression of index
names to limit the returned information
@@ -303,7 +294,6 @@ class CatClient(NamespacedClient):
"""
Provides a detailed view of shard allocation on nodes.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-shards.html>`_
:arg index: A comma-separated list of index names to limit the
returned information
@@ -332,7 +322,6 @@ class CatClient(NamespacedClient):
"""
Provides low-level information about the segments in the shards of an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-segments.html>`_
:arg index: A comma-separated list of index names to limit the
returned information
@@ -355,7 +344,6 @@ class CatClient(NamespacedClient):
"""
Returns a concise representation of the cluster pending tasks.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-pending-tasks.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -381,7 +369,6 @@ class CatClient(NamespacedClient):
Returns cluster-wide thread pool statistics per node. By default the active,
queue and rejected statistics are returned for all thread pools.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-thread-pool.html>`_
:arg thread_pool_patterns: A comma-separated list of regular-
expressions to filter the thread pools in the output
@@ -412,7 +399,6 @@ class CatClient(NamespacedClient):
Shows how much heap memory is currently being used by fielddata on every data
node in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-fielddata.html>`_
:arg fields: A comma-separated list of fields to return in the
output
@@ -440,7 +426,6 @@ class CatClient(NamespacedClient):
"""
Returns information about installed plugins across nodes node.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-plugins.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -465,7 +450,6 @@ class CatClient(NamespacedClient):
"""
Returns information about custom node attributes.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-nodeattrs.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -488,7 +472,6 @@ class CatClient(NamespacedClient):
"""
Returns information about snapshot repositories registered in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-repositories.html>`_
:arg format: a short version of the Accept header, e.g. json,
yaml
@@ -513,7 +496,6 @@ class CatClient(NamespacedClient):
"""
Returns all snapshots in a specific repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-snapshots.html>`_
:arg repository: Name of repository from which to fetch the
snapshot information
@@ -555,7 +537,6 @@ class CatClient(NamespacedClient):
Returns information about the tasks currently executing on one or more nodes in
the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html>`_
:arg actions: A comma-separated list of actions that should be
returned. Leave empty to return all.
@@ -584,7 +565,6 @@ class CatClient(NamespacedClient):
"""
Returns information about existing templates.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-templates.html>`_
:arg name: A pattern that returned template names must match
:arg format: a short version of the Accept header, e.g. json,
@@ -608,7 +588,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about data frame analytics jobs.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-dfanalytics.html>`_
:arg id: The ID of the data frame analytics to fetch
:arg allow_no_match: Whether to ignore if a wildcard expression
@@ -640,7 +619,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about datafeeds.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-datafeeds.html>`_
:arg datafeed_id: The ID of the datafeeds stats to fetch
:arg allow_no_datafeeds: Whether to ignore if a wildcard
@@ -681,7 +659,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about anomaly detection jobs.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-anomaly-detectors.html>`_
:arg job_id: The ID of the jobs stats to fetch
:arg allow_no_jobs: Whether to ignore if a wildcard expression
@@ -725,7 +702,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about inference trained models.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-trained-model.html>`_
:arg model_id: The ID of the trained models stats to fetch
:arg allow_no_match: Whether to ignore if a wildcard expression
@@ -764,7 +740,6 @@ class CatClient(NamespacedClient):
"""
Gets configuration and usage information about transforms.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cat-transforms.html>`_
:arg transform_id: The id of the transform for which to get
stats. '_all' or '*' implies all transforms
-15
View File
@@ -45,7 +45,6 @@ class ClusterClient(NamespacedClient):
"""
Returns basic information about the health of the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-health.html>`_
:arg index: Limit the information returned to a specific index
:arg expand_wildcards: Whether to expand wildcard expression to
@@ -85,7 +84,6 @@ class ClusterClient(NamespacedClient):
Returns a list of any cluster-level changes (e.g. create index, update mapping,
allocate or fail shard) which have not yet been executed.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-pending.html>`_
:arg local: Return local information, do not retrieve the state
from master node (default: false)
@@ -109,7 +107,6 @@ class ClusterClient(NamespacedClient):
"""
Returns a comprehensive information about the state of the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-state.html>`_
:arg metric: Limit the information returned to the specified
metrics Valid choices: _all, blocks, metadata, nodes, routing_table,
@@ -149,7 +146,6 @@ class ClusterClient(NamespacedClient):
"""
Returns high-level overview of cluster statistics.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-stats.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
@@ -175,7 +171,6 @@ class ClusterClient(NamespacedClient):
"""
Allows to manually change the allocation of individual shards in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-reroute.html>`_
:arg body: The definition of `commands` to perform (`move`,
`cancel`, `allocate`)
@@ -201,7 +196,6 @@ class ClusterClient(NamespacedClient):
"""
Returns cluster settings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-get-settings.html>`_
:arg flat_settings: Return settings in flat format (default:
false)
@@ -220,7 +214,6 @@ class ClusterClient(NamespacedClient):
"""
Updates the cluster settings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-update-settings.html>`_
:arg body: The settings to be updated. Can be either `transient`
or `persistent` (survives cluster restart).
@@ -242,7 +235,6 @@ class ClusterClient(NamespacedClient):
"""
Returns the information about configured remote clusters.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-remote-info.html>`_
"""
return self.transport.perform_request(
"GET", "/_remote/info", params=params, headers=headers
@@ -253,7 +245,6 @@ class ClusterClient(NamespacedClient):
"""
Provides explanations for shard allocations in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-allocation-explain.html>`_
:arg body: The index, shard, and primary flag to explain. Empty
means 'explain the first unassigned shard'
@@ -275,7 +266,6 @@ class ClusterClient(NamespacedClient):
"""
Deletes a component template
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-component-template.html>`_
:arg name: The name of the template
:arg master_timeout: Specify timeout for connection to master
@@ -296,7 +286,6 @@ class ClusterClient(NamespacedClient):
"""
Returns one or more component templates
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-component-template.html>`_
:arg name: The comma separated names of the component templates
:arg local: Return local information, do not retrieve the state
@@ -316,7 +305,6 @@ class ClusterClient(NamespacedClient):
"""
Creates or updates a component template
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-component-template.html>`_
:arg name: The name of the template
:arg body: The template definition
@@ -342,7 +330,6 @@ class ClusterClient(NamespacedClient):
"""
Returns information about whether a particular component template exist
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-component-template.html>`_
:arg name: The name of the template
:arg local: Return local information, do not retrieve the state
@@ -365,7 +352,6 @@ class ClusterClient(NamespacedClient):
"""
Clears cluster voting config exclusions.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/voting-config-exclusions.html>`_
:arg wait_for_removal: Specifies whether to wait for all
excluded nodes to be removed from the cluster before clearing the voting
@@ -383,7 +369,6 @@ class ClusterClient(NamespacedClient):
"""
Updates the cluster voting config exclusions by node ids or node names.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/voting-config-exclusions.html>`_
:arg node_ids: A comma-separated list of the persistent ids of
the nodes to exclude from the voting configuration. If specified, you
-3
View File
@@ -33,7 +33,6 @@ class DanglingIndicesClient(NamespacedClient):
"""
Deletes the specified dangling index
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-gateway-dangling-indices.html>`_
:arg index_uuid: The UUID of the dangling index
:arg accept_data_loss: Must be set to true in order to delete
@@ -56,7 +55,6 @@ class DanglingIndicesClient(NamespacedClient):
"""
Imports the specified dangling index
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-gateway-dangling-indices.html>`_
:arg index_uuid: The UUID of the dangling index
:arg accept_data_loss: Must be set to true in order to import
@@ -76,7 +74,6 @@ class DanglingIndicesClient(NamespacedClient):
"""
Returns all dangling indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-gateway-dangling-indices.html>`_
"""
return self.transport.perform_request(
"GET", "/_dangling", params=params, headers=headers
-2
View File
@@ -34,7 +34,6 @@ class FeaturesClient(NamespacedClient):
Gets a list of features which can be included in snapshots using the
feature_states field when creating a snapshot
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-features-api.html>`_
:arg master_timeout: Explicit operation timeout for connection
to master node
@@ -48,7 +47,6 @@ class FeaturesClient(NamespacedClient):
"""
Resets the internal state of features, usually by deleting system indices
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
.. warning::
-57
View File
@@ -34,7 +34,6 @@ class IndicesClient(NamespacedClient):
Performs the analysis process on a text and return the tokens breakdown of the
text.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-analyze.html>`_
:arg body: Define analyzer/tokenizer parameters and the text on
which the analysis should be performed
@@ -53,7 +52,6 @@ class IndicesClient(NamespacedClient):
"""
Performs the refresh operation in one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-refresh.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -81,7 +79,6 @@ class IndicesClient(NamespacedClient):
"""
Performs the flush operation on one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-flush.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string for all indices
@@ -114,7 +111,6 @@ class IndicesClient(NamespacedClient):
"""
Creates an index with optional settings and mappings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-create-index.html>`_
:arg index: The name of the index
:arg body: The configuration for the index (`settings` and
@@ -138,7 +134,6 @@ class IndicesClient(NamespacedClient):
"""
Clones an index
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-clone-index.html>`_
:arg index: The name of the source index to clone
:arg target: The name of the target index to clone into
@@ -175,7 +170,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-index.html>`_
:arg index: A comma-separated list of index names
:arg allow_no_indices: Ignore if a wildcard expression resolves
@@ -214,7 +208,6 @@ class IndicesClient(NamespacedClient):
"""
Opens an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-open-close.html>`_
:arg index: A comma separated list of indices to open
:arg allow_no_indices: Whether to ignore if a wildcard indices
@@ -249,7 +242,6 @@ class IndicesClient(NamespacedClient):
"""
Closes an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-open-close.html>`_
:arg index: A comma separated list of indices to close
:arg allow_no_indices: Whether to ignore if a wildcard indices
@@ -285,7 +277,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-delete-index.html>`_
:arg index: A comma-separated list of indices to delete; use
`_all` or `*` string to delete all indices
@@ -318,7 +309,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about whether a particular index exists.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-exists.html>`_
:arg index: A comma-separated list of index names
:arg allow_no_indices: Ignore if a wildcard expression resolves
@@ -348,7 +338,6 @@ class IndicesClient(NamespacedClient):
Returns information about whether a particular document type exists.
(DEPRECATED)
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-types-exists.html>`_
:arg index: A comma-separated list of index names; use `_all` to
check the types across all indices
@@ -388,7 +377,6 @@ class IndicesClient(NamespacedClient):
"""
Updates the index mappings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-put-mapping.html>`_
:arg body: The mapping definition
:arg index: A comma-separated list of index names the mapping
@@ -436,7 +424,6 @@ class IndicesClient(NamespacedClient):
"""
Returns mappings for one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-mapping.html>`_
:arg index: A comma-separated list of index names
:arg doc_type: A comma-separated list of document types
@@ -475,7 +462,6 @@ class IndicesClient(NamespacedClient):
"""
Returns mapping for one or more fields.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-field-mapping.html>`_
:arg fields: A comma-separated list of fields
:arg index: A comma-separated list of index names
@@ -510,7 +496,6 @@ class IndicesClient(NamespacedClient):
"""
Creates or updates an alias.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg index: A comma-separated list of index names the alias
should point to (supports wildcards); use `_all` to perform the
@@ -538,7 +523,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about whether a particular alias exists.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg name: A comma-separated list of alias names to return
:arg index: A comma-separated list of index names to filter
@@ -566,7 +550,6 @@ class IndicesClient(NamespacedClient):
"""
Returns an alias.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg index: A comma-separated list of index names to filter
aliases
@@ -591,7 +574,6 @@ class IndicesClient(NamespacedClient):
"""
Updates index aliases.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg body: The definition of `actions` to perform
:arg master_timeout: Specify timeout for connection to master
@@ -609,7 +591,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes an alias.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-aliases.html>`_
:arg index: A comma-separated list of index names (supports
wildcards); use `_all` for all indices
@@ -631,7 +612,6 @@ class IndicesClient(NamespacedClient):
"""
Creates or updates an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg body: The template definition
@@ -661,7 +641,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about whether a particular index template exists.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The comma separated names of the index templates
:arg flat_settings: Return settings in flat format (default:
@@ -683,7 +662,6 @@ class IndicesClient(NamespacedClient):
"""
Returns an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The comma separated names of the index templates
:arg flat_settings: Return settings in flat format (default:
@@ -704,7 +682,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg master_timeout: Specify timeout for connection to master
@@ -730,7 +707,6 @@ class IndicesClient(NamespacedClient):
"""
Returns settings for one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-get-settings.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -768,7 +744,6 @@ class IndicesClient(NamespacedClient):
"""
Updates the index settings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-update-settings.html>`_
:arg body: The index settings to be updated
:arg index: A comma-separated list of index names; use `_all` or
@@ -816,7 +791,6 @@ class IndicesClient(NamespacedClient):
"""
Provides statistics on operations happening in an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-stats.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -860,7 +834,6 @@ class IndicesClient(NamespacedClient):
"""
Provides low-level information about segments in a Lucene index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-segments.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -898,7 +871,6 @@ class IndicesClient(NamespacedClient):
"""
Allows a user to validate a potentially expensive query without executing it.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-validate.html>`_
:arg body: The query definition specified with the Query DSL
:arg index: A comma-separated list of index names to restrict
@@ -952,7 +924,6 @@ class IndicesClient(NamespacedClient):
"""
Clears all or specific caches for one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-clearcache.html>`_
:arg index: A comma-separated list of index name to limit the
operation
@@ -979,7 +950,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about ongoing index shard recoveries.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-recovery.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1003,7 +973,6 @@ class IndicesClient(NamespacedClient):
"""
DEPRECATED Upgrades to the current version of Lucene.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1029,7 +998,6 @@ class IndicesClient(NamespacedClient):
"""
DEPRECATED Returns a progress status of current upgrade.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1052,7 +1020,6 @@ class IndicesClient(NamespacedClient):
Performs a synced flush operation on one or more indices. Synced flush is
deprecated and will be removed in 8.0. Use flush instead
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-synced-flush-api.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string for all indices
@@ -1079,7 +1046,6 @@ class IndicesClient(NamespacedClient):
"""
Provides store information for shard copies of indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-shards-stores.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1111,7 +1077,6 @@ class IndicesClient(NamespacedClient):
"""
Performs the force merge operation on one or more indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-forcemerge.html>`_
:arg index: A comma-separated list of index names; use `_all` or
empty string to perform the operation on all indices
@@ -1141,7 +1106,6 @@ class IndicesClient(NamespacedClient):
"""
Allow to shrink an existing index into a new index with fewer primary shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-shrink-index.html>`_
:arg index: The name of the source index to shrink
:arg target: The name of the target index to shrink into
@@ -1174,7 +1138,6 @@ class IndicesClient(NamespacedClient):
Allows you to split an existing index into a new index with more primary
shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-split-index.html>`_
:arg index: The name of the source index to split
:arg target: The name of the target index to split into
@@ -1211,7 +1174,6 @@ class IndicesClient(NamespacedClient):
Updates an alias to point to a new index when the existing index is considered
to be too large or too old.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-rollover-index.html>`_
:arg alias: The name of the alias to rollover
:arg body: The conditions that needs to be met for executing
@@ -1252,7 +1214,6 @@ class IndicesClient(NamespacedClient):
Freezes an index. A frozen index has almost no overhead on the cluster (except
for maintaining its metadata in memory) and is read-only.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/freeze-index-api.html>`_
:arg index: The name of the index to freeze
:arg allow_no_indices: Whether to ignore if a wildcard indices
@@ -1288,7 +1249,6 @@ class IndicesClient(NamespacedClient):
Unfreezes an index. When a frozen index is unfrozen, the index goes through the
normal recovery process and becomes writeable again.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/unfreeze-index-api.html>`_
:arg index: The name of the index to unfreeze
:arg allow_no_indices: Whether to ignore if a wildcard indices
@@ -1316,7 +1276,6 @@ class IndicesClient(NamespacedClient):
"""
Reloads an index's search analyzers and their resources.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-reload-analyzers.html>`_
:arg index: A comma-separated list of index names to reload
analyzers for
@@ -1344,7 +1303,6 @@ class IndicesClient(NamespacedClient):
"""
Creates a data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: The name of the data stream
"""
@@ -1360,7 +1318,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes a data stream.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: A comma-separated list of data streams to delete; use
`*` to delete all data streams
@@ -1380,7 +1337,6 @@ class IndicesClient(NamespacedClient):
"""
Deletes an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg master_timeout: Specify timeout for connection to master
@@ -1401,7 +1357,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about whether a particular index template exists.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg flat_settings: Return settings in flat format (default:
@@ -1423,7 +1378,6 @@ class IndicesClient(NamespacedClient):
"""
Returns an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The comma separated names of the index templates
:arg flat_settings: Return settings in flat format (default:
@@ -1442,7 +1396,6 @@ class IndicesClient(NamespacedClient):
"""
Creates or updates an index template.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the template
:arg body: The template definition
@@ -1470,7 +1423,6 @@ class IndicesClient(NamespacedClient):
Simulate matching the given index name against the index templates in the
system
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg name: The name of the index (it must be a concrete index
name)
@@ -1499,7 +1451,6 @@ class IndicesClient(NamespacedClient):
"""
Returns data streams.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: A comma-separated list of data streams to get; use
`*` to get all data streams
@@ -1516,7 +1467,6 @@ class IndicesClient(NamespacedClient):
"""
Simulate resolving the given template name or body
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-templates.html>`_
:arg body: New index template definition to be simulated, if no
index template name is specified
@@ -1541,7 +1491,6 @@ class IndicesClient(NamespacedClient):
"""
Returns information about any matching indices, aliases, and data streams
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-resolve-index-api.html>`_
.. warning::
@@ -1572,7 +1521,6 @@ class IndicesClient(NamespacedClient):
"""
Adds a block to an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/index-modules-blocks.html>`_
:arg index: A comma separated list of indices to add a block to
:arg block: The block to add (one of read, write, read_only or
@@ -1601,7 +1549,6 @@ class IndicesClient(NamespacedClient):
"""
Provides statistics on operations happening in a data stream.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: A comma-separated list of data stream names; use
`_all` or empty string to perform the operation on all data streams
@@ -1619,7 +1566,6 @@ class IndicesClient(NamespacedClient):
Promotes a data stream from a replicated data stream managed by CCR to a
regular data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: The name of the data stream
"""
@@ -1638,7 +1584,6 @@ class IndicesClient(NamespacedClient):
"""
Migrates an alias to a data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/data-streams.html>`_
:arg name: The name of the alias to migrate
"""
@@ -1663,7 +1608,6 @@ class IndicesClient(NamespacedClient):
"""
Analyzes the disk usage of each field of an index or data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-disk-usage.html>`_
.. warning::
@@ -1699,7 +1643,6 @@ class IndicesClient(NamespacedClient):
"""
Returns the field usage stats for each field of an index
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-field-usage-stats.html>`_
.. warning::
-6
View File
@@ -33,7 +33,6 @@ class IngestClient(NamespacedClient):
"""
Returns a pipeline.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-pipeline-api.html>`_
:arg id: Comma separated list of pipeline ids. Wildcards
supported
@@ -51,7 +50,6 @@ class IngestClient(NamespacedClient):
"""
Creates or updates a pipeline.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-pipeline-api.html>`_
:arg id: Pipeline ID
:arg body: The ingest definition
@@ -76,7 +74,6 @@ class IngestClient(NamespacedClient):
"""
Deletes a pipeline.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-pipeline-api.html>`_
:arg id: Pipeline ID
:arg master_timeout: Explicit operation timeout for connection
@@ -98,7 +95,6 @@ class IngestClient(NamespacedClient):
"""
Allows to simulate a pipeline with example documents.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/simulate-pipeline-api.html>`_
:arg body: The simulate definition
:arg id: Pipeline ID
@@ -121,7 +117,6 @@ class IngestClient(NamespacedClient):
"""
Returns a list of the built-in patterns.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/grok-processor.html#grok-processor-rest-get>`_
"""
return self.transport.perform_request(
"GET", "/_ingest/processor/grok", params=params, headers=headers
@@ -132,7 +127,6 @@ class IngestClient(NamespacedClient):
"""
Returns statistical information about geoip databases
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/geoip-stats-api.html>`_
"""
return self.transport.perform_request(
"GET", "/_ingest/geoip/stats", params=params, headers=headers
-5
View File
@@ -35,7 +35,6 @@ class NodesClient(NamespacedClient):
"""
Reloads secure settings.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/secure-settings.html#reloadable-secure-settings>`_
:arg body: An object containing the password for the
elasticsearch keystore
@@ -57,7 +56,6 @@ class NodesClient(NamespacedClient):
"""
Returns information about nodes in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-info.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
@@ -91,7 +89,6 @@ class NodesClient(NamespacedClient):
"""
Returns statistical information about nodes in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-stats.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
@@ -139,7 +136,6 @@ class NodesClient(NamespacedClient):
"""
Returns information about hot threads on each node in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-hot-threads.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
@@ -173,7 +169,6 @@ class NodesClient(NamespacedClient):
"""
Returns low-level information about REST actions usage on nodes.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-nodes-usage.html>`_
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
-3
View File
@@ -30,9 +30,6 @@ from .utils import NamespacedClient, query_params
class RemoteClient(NamespacedClient):
@query_params()
def info(self, params=None, headers=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-remote-info.html>`_
"""
return self.transport.perform_request(
"GET", "/_remote/info", params=params, headers=headers
)
-12
View File
@@ -33,7 +33,6 @@ class SnapshotClient(NamespacedClient):
"""
Creates a snapshot in a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A snapshot name
@@ -60,7 +59,6 @@ class SnapshotClient(NamespacedClient):
"""
Deletes a snapshot.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A snapshot name
@@ -89,7 +87,6 @@ class SnapshotClient(NamespacedClient):
"""
Returns information about a snapshot.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
@@ -121,7 +118,6 @@ class SnapshotClient(NamespacedClient):
"""
Deletes a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: Name of the snapshot repository to unregister.
Wildcard (`*`) patterns are supported.
@@ -144,7 +140,6 @@ class SnapshotClient(NamespacedClient):
"""
Returns information about a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A comma-separated list of repository names
:arg local: Return local information, do not retrieve the state
@@ -161,7 +156,6 @@ class SnapshotClient(NamespacedClient):
"""
Creates a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg body: The repository definition
@@ -187,7 +181,6 @@ class SnapshotClient(NamespacedClient):
"""
Restores a snapshot.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A snapshot name
@@ -214,7 +207,6 @@ class SnapshotClient(NamespacedClient):
"""
Returns information about the status of a snapshot.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
@@ -236,7 +228,6 @@ class SnapshotClient(NamespacedClient):
"""
Verifies a repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg master_timeout: Explicit operation timeout for connection
@@ -258,7 +249,6 @@ class SnapshotClient(NamespacedClient):
"""
Removes stale data from repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/clean-up-snapshot-repo-api.html>`_
:arg repository: A repository name
:arg master_timeout: Explicit operation timeout for connection
@@ -282,7 +272,6 @@ class SnapshotClient(NamespacedClient):
"""
Clones indices from one snapshot into another snapshot in the same repository.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: The name of the snapshot to clone from
@@ -320,7 +309,6 @@ class SnapshotClient(NamespacedClient):
"""
Analyzes a repository for correctness and performance
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
:arg repository: A repository name
:arg blob_count: Number of blobs to create during the test.
-3
View File
@@ -43,7 +43,6 @@ class TasksClient(NamespacedClient):
"""
Returns a list of tasks.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html>`_
.. warning::
@@ -73,7 +72,6 @@ class TasksClient(NamespacedClient):
"""
Cancels a task, if it can be cancelled through an API.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html>`_
.. warning::
@@ -105,7 +103,6 @@ class TasksClient(NamespacedClient):
"""
Returns information about a task.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/tasks.html>`_
.. warning::
+1 -1
View File
@@ -346,7 +346,7 @@ class Connection(object):
def _get_api_key_header_val(self, api_key):
"""
Check the type of the passed api_key and return the correct header value
for the `API Key authentication <https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html>`
for the API Key authentication
:arg api_key, either a tuple or a base64 encoded string
"""
if isinstance(api_key, (tuple, list)):
-2
View File
@@ -86,5 +86,3 @@ def docs(session):
"-rdev-requirements.txt", "sphinx-rtd-theme", "sphinx-autodoc-typehints"
)
session.run("python", "-m", "pip", "install", "sphinx-autodoc-typehints")
session.run("sphinx-build", "docs/sphinx/", "docs/sphinx/_build", "-b", "html")
-5
View File
@@ -1,8 +1,3 @@
[build_sphinx]
source-dir = docs/
build-dir = docs/_build
all_files = 1
[bdist_wheel]
universal = 1