Skip to content

Commit

Permalink
more documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Apr 2, 2024
1 parent 9c8e63d commit c172281
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 28 deletions.
11 changes: 0 additions & 11 deletions docs/howtos.rst

This file was deleted.

59 changes: 53 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,31 @@ running queries against Elasticsearch. It is built on top of the official
low-level client (`elasticsearch-py <https://github.com/elastic/elasticsearch-py>`_).

It provides a more convenient and idiomatic way to write and manipulate
queries using synchronous or asynchronous Python. It stays close to the
Elasticsearch JSON DSL, mirroring its terminology and structure. It exposes the
whole range of the DSL from Python either directly using defined classes or a
queryset-like expressions.
queries. It stays close to the Elasticsearch JSON DSL, mirroring its
terminology and structure. It exposes the whole range of the DSL from Python
either directly using defined classes or a queryset-like expressions. Here is
an example::

from elasticsearch_dsl import Search

s = Search(index="my-index") \
.filter("term", category="search") \
.query("match", title="python") \
.exclude("match", description="beta")
for hit in s:
print(hit.title)

Or with asynchronous Python::

from elasticsearch_dsl import AsyncSearch

async def run_query():
s = AsyncSearch(index="my-index") \
.filter("term", category="search") \
.query("match", title="python") \
.exclude("match", description="beta")
async for hit in s:
print(hit.title)

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

.. toctree::
:caption: About
:maxdepth: 2

self
configuration

.. toctree::
:caption: Tutorials
:maxdepth: 2

tutorials
howtos
reference

.. toctree::
:caption: How-To Guides
:maxdepth: 2

search_dsl
persistence
faceted_search
update_by_query
asyncio

.. toctree::
:caption: Reference
:maxdepth: 2

api
async_api

.. toctree::
:caption: Community
:maxdepth: 2

CONTRIBUTING
Changelog
8 changes: 0 additions & 8 deletions docs/reference.rst

This file was deleted.

3 changes: 0 additions & 3 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Tutorials
=========

Search
------

Expand Down

0 comments on commit c172281

Please sign in to comment.