From cd0fa1fbfff58c8392905fbe5ad801a9acfd90b2 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Mon, 28 Apr 2025 07:13:28 -0500 Subject: [PATCH] [docs] Fix various syntax and rendering errors (#2940) * fix various syntax and rendering issues * fix image (cherry picked from commit 631956d262bc8e9faee7b1b09ab564e23aedf321) --- docs/reference/client-helpers.md | 2 +- docs/{ => reference}/images/python-example.png | Bin docs/reference/querying.md | 8 +++----- 3 files changed, 4 insertions(+), 6 deletions(-) rename docs/{ => reference}/images/python-example.png (100%) diff --git a/docs/reference/client-helpers.md b/docs/reference/client-helpers.md index 904d61815..38cea019d 100644 --- a/docs/reference/client-helpers.md +++ b/docs/reference/client-helpers.md @@ -12,7 +12,7 @@ You can find here a collection of simple helper functions that abstract some spe 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). +All bulk helpers accept an instance of `Elasticsearch` 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: diff --git a/docs/images/python-example.png b/docs/reference/images/python-example.png similarity index 100% rename from docs/images/python-example.png rename to docs/reference/images/python-example.png diff --git a/docs/reference/querying.md b/docs/reference/querying.md index 5d701280d..a4946d340 100644 --- a/docs/reference/querying.md +++ b/docs/reference/querying.md @@ -6,7 +6,7 @@ The Python Elasticsearch client provides several ways to send queries to Elastic Elasticsearch APIs are grouped by namespaces. - * There's the global namespace, with APIs like the Search API (`GET _search`) or the Index API (`PUT //_doc/<_id>` and related endpoints). + * There's the global namespace, with APIs like the Search API (`GET _search`) or the Index API (`PUT //_doc/<_id>` and related endpoints). * Then there are all the other namespaces, such as: * Indices with APIs like the Create index API (`PUT /my-index`), * ES|QL with the Run an ES|QL query API (`POST /_async`), @@ -28,10 +28,8 @@ How can you figure out the namespace? * Finally, for Elasticsearch 8.x, most examples in the [Elasticsearch guide](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html) are also available in Python. (This is still a work in progress for Elasticsearch 9.x.) In the example below, `client.ingest.put_pipeline(...)` is the function that calls the "Create or update a pipeline" API. -:::{image} ../images/python-example.png -:alt: Python code example in the Elasticsearch guide -::: - +![Python code example in the Elasticsearch guide](images/python-example.png) + ## Parameters Now that you know which functions to call, the next step is parameters. To avoid ambiguity, the Python Elasticsearch client mandates keyword arguments. To give an example, let's look at the ["Create an index" API](https://elasticsearch-py.readthedocs.io/en/stable/api/indices.html#elasticsearch.client.IndicesClient.create). There's only one required parameter, `index`, so the minimal form looks like this: