Skip to content

Commit 9ab0771

Browse files
Expand the overview section of the docs
1 parent 06f25a0 commit 9ab0771

File tree

1 file changed

+47
-26
lines changed

1 file changed

+47
-26
lines changed

docs/reference/index.md

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,43 @@ mapped_pages:
99

1010
This documentation covers the [official Python client for {{es}}](https://github.com/elastic/elasticsearch-py). The goal of the Python client is to provide common ground for all {{es}}-related code in Python. The client is designed to be unopinionated and extendable.
1111

12-
API reference documentation is provided on [Read the Docs](https://elasticsearch-py.readthedocs.io).
13-
14-
15-
The following example shows a simple Python client use case:
12+
## Example [_example]
1613

1714
```python
18-
>>> from datetime import datetime
19-
>>> from elasticsearch import Elasticsearch
20-
21-
# Connect to 'http://localhost:9200'
22-
>>> client = Elasticsearch("http://localhost:9200")
15+
import os
16+
from elasticsearch import Elasticsearch
17+
18+
client = Elasticsearch(
19+
hosts=[os.getenv("ELASTICSEARCH_URL")],
20+
api_key=os.getenv("ELASTIC_API_KEY"),
21+
)
22+
23+
resp = client.search(
24+
index="my-index-000001",
25+
from_="40",
26+
size="20",
27+
query={
28+
"term": {
29+
"user.id": "kimchy"
30+
}
31+
},
32+
)
33+
print(resp)
34+
```
2335

24-
# Datetimes will be serialized:
25-
>>> client.index(index="my-index-000001", id=42, document={"any": "data", "timestamp": datetime.now()})
26-
{'_id': '42', '_index': 'my-index-000001', '_type': 'test-type', '_version': 1, 'ok': True}
36+
## Overview
2737

28-
# ...but not deserialized
29-
>>> client.get(index="my-index-000001", id=42)['_source']
30-
{'any': 'data', 'timestamp': '2013-05-12T19:45:31.804229'}
31-
```
38+
This package is composed of several modules:
3239

40+
### The actual client
3341

42+
This module, sometimes also called the "low-level" client, implements the support for sending requests to {{es}} servers. The client provides access to the entire surface of the {{es}} API.
3443

44+
* [Getting Started guide](getting-started.md)
45+
* [Ingest data with Python walkthrough](docs-content://manage-data/ingest/ingesting-data-from-applications/ingest-data-with-python-on-elasticsearch-service.md)
46+
* [Reference documentation](https://elasticsearch-py.readthedocs.io/en/stable/es_api.html)
3547

36-
## Features [_features]
48+
#### Features [_features]
3749

3850
The client's features include:
3951

@@ -45,19 +57,28 @@ The client's features include:
4557
* Thread safety
4658
* Pluggable architecture
4759

48-
The client also provides a convenient set of [helpers](client-helpers.md) for tasks like bulk indexing and reindexing.
60+
### Bulk helpers
4961

50-
::::{tip}
51-
To get started, try this walkthrough: [Ingest data with Python](docs-content://manage-data/ingest/ingesting-data-from-applications/ingest-data-with-python-on-elasticsearch-service.md)
52-
::::
62+
The bulk helpers are a set of functions that simplify the ingest of large amounts of data through a high-level interface based on Python iterables.
5363

54-
### Elasticsearch Python DSL [_elasticsearch_python_dsl]
64+
* [User guide](client-helpers.md#bulk-helpers)
65+
* [Reference documentation](https://elasticsearch-py.readthedocs.io/en/stable/api_helpers.html)
5566

56-
The [Python DSL module](../reference/elasticsearch-dsl.md) offers a convenient and idiomatic way to write and manipulate queries.
67+
### ES|QL query builder
5768

58-
## {{es}} version compatibility [_compatibility]
69+
This module offers an idiomatic interface to construct ES|QL queries using Python expressions.
5970

60-
Language clients are **forward compatible**: each client version works with equivalent and later minor versions of the **same or next major** version of {{es}}. For full compatibility, the client and {{es}} minor versions should match.
71+
* [User guide](esql-query-builder.md)
72+
* [Reference documentation](https://elasticsearch-py.readthedocs.io/en/stable/esql.html)
73+
74+
### DSL module
75+
76+
The DSL module could be thought of as a "high-level" client for {{es}}. It allows applications to manipulate documents and queries using Python classes and objects instead of primitive types such as dictionaries and lists.
77+
78+
* [User guide](elasticsearch-dsl.md)
79+
* [Reference documentation](https://elasticsearch-py.readthedocs.io/en/stable/dsl.html)
80+
81+
## Compatibility [_compatibility]
6182

6283
| Client version | {{es}} `8.x` | {{es}} `9.x` | {{es}} `10.x` |
6384
|----------------|---------------------------------|---------------------------------|----------------------------------|
@@ -82,4 +103,4 @@ In the Python client, compatibility mode is always enabled.
82103

83104
:::{tip}
84105
To support working with multiple client versions, the Python client is also released under the package names `elasticsearch8` and `elasticsearch9` (to prevent name collisions).
85-
:::
106+
:::

0 commit comments

Comments
 (0)