Skip to content

Commit c172281

Browse files
more documentation improvements
1 parent 9c8e63d commit c172281

File tree

4 files changed

+53
-28
lines changed

4 files changed

+53
-28
lines changed

docs/howtos.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/index.rst

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,31 @@ running queries against Elasticsearch. It is built on top of the official
66
low-level client (`elasticsearch-py <https://github.com/elastic/elasticsearch-py>`_).
77

88
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)
1334

1435
It also provides an optional wrapper for working with documents as Python
1536
objects: defining mappings, retrieving and saving documents, wrapping the
@@ -101,12 +122,38 @@ Contents
101122
--------
102123

103124
.. toctree::
125+
:caption: About
104126
:maxdepth: 2
105127

106128
self
107129
configuration
130+
131+
.. toctree::
132+
:caption: Tutorials
133+
:maxdepth: 2
134+
108135
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+
111158
CONTRIBUTING
112159
Changelog

docs/reference.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/tutorials.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
Tutorials
2-
=========
3-
41
Search
52
------
63

0 commit comments

Comments
 (0)