Skip to content

Commit

Permalink
add DSL module reference documentation to sphinx docs
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Jan 29, 2025
1 parent 8aee949 commit cf00a30
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 11 deletions.
68 changes: 68 additions & 0 deletions docs/sphinx/dsl.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.. _dsl:

Python DSL Reference
====================

.. py:module:: elasticsearch.dsl
Synchronous classes
-------------------

.. autoclass:: Search
:inherited-members:
:members:

.. autoclass:: MultiSearch
:inherited-members:
:members:

.. autoclass:: Document
:inherited-members:
:members:

.. autoclass:: Index
:inherited-members:
:members:

.. autoclass:: Mapping
:inherited-members:
:members:

.. autoclass:: FacetedSearch
:inherited-members:
:members:

.. autoclass:: UpdateByQuery
:inherited-members:
:members:

Asynchronous classes
--------------------

.. autoclass:: AsyncSearch
:inherited-members:
:members:

.. autoclass:: AsyncMultiSearch
:inherited-members:
:members:

.. autoclass:: AsyncDocument
:inherited-members:
:members:

.. autoclass:: AsyncIndex
:inherited-members:
:members:

.. autoclass:: AsyncMapping
:inherited-members:
:members:

.. autoclass:: AsyncFacetedSearch
:inherited-members:
:members:

.. autoclass:: AsyncUpdateByQuery
:inherited-members:
:members:
20 changes: 9 additions & 11 deletions docs/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,25 @@ This client was designed as very thin wrapper around Elasticsearch's REST API to
allow for maximum flexibility. This means that there are no opinions in this
client; it also means that some of the APIs are a little cumbersome to use from
Python. We have created some :ref:`helpers` to help with this issue as well as
a more high level library (`elasticsearch-dsl`_) on top of this one to provide
a more convenient way of working with Elasticsearch.
a more high level `DSL module`_ to provide a more convenient way of working
with Elasticsearch.



Elasticsearch-DSL
Elasticsearch DSL
-----------------

For a more high level client library with more limited scope, have a look at
`elasticsearch-dsl`_ - a more pythonic library sitting on top of
``elasticsearch-py``.

`elasticsearch-dsl`_ provides a more convenient and idiomatic way to write and manipulate
`queries`_ by mirroring the terminology and structure of Elasticsearch JSON DSL
while exposing the whole range of the DSL from Python
For a higher level access with more limited scope, have a look at the `DSL
module`_, which provides a more convenient and idiomatic way to write and
manipulate `queries`_ by mirroring the terminology and structure of
Elasticsearch JSON DSL while exposing the whole range of the DSL from Python
either directly using defined classes or a queryset-like expressions.

It also provides an optional `persistence layer`_ for working with documents as
Python objects in an ORM-like fashion: defining mappings, retrieving and saving
documents, wrapping the document data in user-defined classes.

.. _elasticsearch-dsl: https://elasticsearch-dsl.readthedocs.io/
.. _DSL module: https://elasticsearch-dsl.readthedocs.io/
.. _queries: https://elasticsearch-dsl.readthedocs.io/en/latest/search_dsl.html
.. _persistence layer: https://elasticsearch-dsl.readthedocs.io/en/latest/persistence.html#doctype

Expand All @@ -131,6 +128,7 @@ Contents
quickstart
interactive
api
dsl
exceptions
async
helpers
Expand Down

0 comments on commit cf00a30

Please sign in to comment.