@@ -6,10 +6,31 @@ running queries against Elasticsearch. It is built on top of the official
6
6
low-level client (`elasticsearch-py <https://github.com/elastic/elasticsearch-py >`_).
7
7
8
8
It provides a more convenient and idiomatic way to write and manipulate
9
- queries using synchronous or asynchronous Python. It stays close to the
10
- Elasticsearch JSON DSL, mirroring its terminology and structure. It exposes the
11
- whole range of the DSL from Python either directly using defined classes or a
12
- queryset-like expressions.
9
+ queries. It stays close to the Elasticsearch JSON DSL, mirroring its
10
+ terminology and structure. It exposes the whole range of the DSL from Python
11
+ either directly using defined classes or a queryset-like expressions. Here is
12
+ an example::
13
+
14
+ from elasticsearch_dsl import Search
15
+
16
+ s = Search(index="my-index") \
17
+ .filter("term", category="search") \
18
+ .query("match", title="python") \
19
+ .exclude("match", description="beta")
20
+ for hit in s:
21
+ print(hit.title)
22
+
23
+ Or with asynchronous Python::
24
+
25
+ from elasticsearch_dsl import AsyncSearch
26
+
27
+ async def run_query():
28
+ s = AsyncSearch(index="my-index") \
29
+ .filter("term", category="search") \
30
+ .query("match", title="python") \
31
+ .exclude("match", description="beta")
32
+ async for hit in s:
33
+ print(hit.title)
13
34
14
35
It also provides an optional wrapper for working with documents as Python
15
36
objects: defining mappings, retrieving and saving documents, wrapping the
@@ -101,12 +122,38 @@ Contents
101
122
--------
102
123
103
124
.. toctree ::
125
+ :caption: About
104
126
:maxdepth: 2
105
127
106
128
self
107
129
configuration
130
+
131
+ .. toctree ::
132
+ :caption: Tutorials
133
+ :maxdepth: 2
134
+
108
135
tutorials
109
- howtos
110
- reference
136
+
137
+ .. toctree ::
138
+ :caption: How-To Guides
139
+ :maxdepth: 2
140
+
141
+ search_dsl
142
+ persistence
143
+ faceted_search
144
+ update_by_query
145
+ asyncio
146
+
147
+ .. toctree ::
148
+ :caption: Reference
149
+ :maxdepth: 2
150
+
151
+ api
152
+ async_api
153
+
154
+ .. toctree ::
155
+ :caption: Community
156
+ :maxdepth: 2
157
+
111
158
CONTRIBUTING
112
159
Changelog
0 commit comments