Skip to content

Commit a0c133e

Browse files
committed
Clarify Document inheritance and mapping merging
1 parent 6df6d11 commit a0c133e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/persistence.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ Document Inheritance
338338
~~~~~~~~~~~~~~~~~~~~
339339

340340
You can use standard Python inheritance to extend models, this can be useful in
341-
a few scenarios. For example if you want to have a ``BaseDocument`` defining some common fields that several different ``Document`` classes should share:
341+
a few scenarios. For example if you want to have a ``BaseDocument`` defining
342+
some common fields that several different ``Document`` classes should share:
342343

343344
.. code:: python
344345
@@ -365,7 +366,9 @@ Another use case would be using the `join type
365366
<https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html>`_
366367
to have multiple different entities in a single index. You can see an `example
367368
<https://github.com/elastic/elasticsearch-dsl-py/blob/master/examples/parent_child.py>`_
368-
of this approach.
369+
of this approach. Note that in this case, if the subclasses don't define their
370+
own `Index` classes, the mappings are merged and shared between all the
371+
subclasses.
369372

370373
.. _index:
371374

0 commit comments

Comments
 (0)