Skip to content

Commit a251b64

Browse files
Merge pull request #145 from noamkush/support_dsl_6_4
Add support for django-elasticsearch-dsl 6.4
2 parents 006bf89 + 6746957 commit a251b64

29 files changed

+118
-122
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ matrix:
2828
python: 3.7
2929

3030
before_install:
31-
- curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.deb && sudo dpkg -i --force-confnew elasticsearch-5.6.16.deb && sudo service elasticsearch restart
31+
- curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.4.deb && sudo dpkg -i --force-confnew elasticsearch-6.5.4.deb && sudo service elasticsearch restart
3232

3333
install: pip install -r examples/requirements/test.txt
3434

docs/advanced_usage_examples.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Document index
234234
.. code-block:: python
235235
236236
from django.conf import settings
237-
from django_elasticsearch_dsl import DocType, Index, fields
237+
from django_elasticsearch_dsl import Document, Index, fields
238238
from elasticsearch_dsl import analyzer
239239
240240
from books.models import Book
@@ -257,7 +257,7 @@ Document index
257257
258258
259259
@INDEX.doc_type
260-
class BookDocument(DocType):
260+
class BookDocument(Document):
261261
"""Book Elasticsearch document."""
262262
263263
id = fields.IntegerField(attr='id')
@@ -326,7 +326,7 @@ Document index
326326
class Meta(object):
327327
"""Meta options."""
328328
329-
model = Book # The model associate with this DocType
329+
model = Book # The model associate with this Document
330330
331331
Sample serializer
332332
-----------------
@@ -964,7 +964,7 @@ documents using ``fields.CompletionField``.
964964
965965
from django.conf import settings
966966
967-
from django_elasticsearch_dsl import DocType, Index, fields
967+
from django_elasticsearch_dsl import Document, Index, fields
968968
969969
from books.models import Publisher
970970
@@ -979,7 +979,7 @@ documents using ``fields.CompletionField``.
979979
980980
981981
@INDEX.doc_type
982-
class PublisherDocument(DocType):
982+
class PublisherDocument(Document):
983983
"""Publisher Elasticsearch document."""
984984
985985
id = fields.IntegerField(attr='id')
@@ -1028,7 +1028,7 @@ documents using ``fields.CompletionField``.
10281028
class Meta(object):
10291029
"""Meta options."""
10301030
1031-
model = Publisher # The model associate with this DocType
1031+
model = Publisher # The model associate with this Document
10321032
10331033
After that the ``name.suggest``, ``city.suggest``, ``state_province.suggest``
10341034
and ``country.suggest`` fields would be available for suggestions feature.
@@ -1324,7 +1324,7 @@ In that case, the document definition should be altered as follows:
13241324

13251325
.. code-block:: python
13261326
1327-
class BookDocument(DocType):
1327+
class BookDocument(Document):
13281328
13291329
# ...
13301330
@@ -1418,7 +1418,7 @@ In that case, the document definition should be altered as follows:
14181418

14191419
.. code-block:: python
14201420
1421-
class AddressDocument(DocType):
1421+
class AddressDocument(Document):
14221422
14231423
# ...
14241424
@@ -1513,7 +1513,7 @@ Document definition
15131513
15141514
from django.conf import settings
15151515
1516-
from django_elasticsearch_dsl import DocType, Index, fields
1516+
from django_elasticsearch_dsl import Document, Index, fields
15171517
15181518
from books.models import Book
15191519
@@ -1527,7 +1527,7 @@ Document definition
15271527
)
15281528
15291529
@INDEX.doc_type
1530-
class BookDocument(DocType):
1530+
class BookDocument(Document):
15311531
"""Book Elasticsearch document."""
15321532
# ID
15331533
id = fields.IntegerField(attr='id')
@@ -1608,7 +1608,7 @@ Document definition
16081608
class Meta(object):
16091609
"""Meta options."""
16101610
1611-
model = Book # The model associate with this DocType
1611+
model = Book # The model associate with this Document
16121612
16131613
ViewSet definition
16141614
^^^^^^^^^^^^^^^^^^
@@ -2022,7 +2022,7 @@ The following example indicates Ngram analyzer/filter usage.
20222022
.. code-block:: python
20232023
20242024
from django.conf import settings
2025-
from django_elasticsearch_dsl import DocType, Index, fields
2025+
from django_elasticsearch_dsl import Document, Index, fields
20262026
20272027
from elasticsearch_dsl import analyzer
20282028
from elasticsearch_dsl.analysis import token_filter
@@ -2052,7 +2052,7 @@ The following example indicates Ngram analyzer/filter usage.
20522052
)
20532053
20542054
@INDEX.doc_type
2055-
class BookDocument(DocType):
2055+
class BookDocument(Document):
20562056
"""Book Elasticsearch document."""
20572057
20582058
# In different parts of the code different fields are used. There are
@@ -2083,7 +2083,7 @@ The following example indicates Ngram analyzer/filter usage.
20832083
class Meta(object):
20842084
"""Meta options."""
20852085
2086-
model = Book # The model associate with this DocType
2086+
model = Book # The model associate with this Document
20872087
20882088
ViewSet definition
20892089
~~~~~~~~~~~~~~~~~~

docs/basic_usage_examples.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Sample document
7777

7878
.. code-block:: python
7979
80-
from django_elasticsearch_dsl import DocType, Index, fields
80+
from django_elasticsearch_dsl import Document, Index, fields
8181
from elasticsearch_dsl import analyzer
8282
8383
from books.models import Publisher
@@ -92,7 +92,7 @@ Sample document
9292
9393
9494
@PUBLISHER_INDEX.doc_type
95-
class PublisherDocument(DocType):
95+
class PublisherDocument(Document):
9696
"""Publisher Elasticsearch document."""
9797
9898
id = fields.IntegerField(attr='id')
@@ -135,7 +135,7 @@ Sample document
135135
class Meta(object):
136136
"""Meta options."""
137137
138-
model = Publisher # The model associate with this DocType
138+
model = Publisher # The model associate with this Document
139139
140140
141141
Sample serializer

docs/indexing_troubleshooting.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ document meta.
9494

9595
.. code-block:: python
9696
97-
class LocationDocument(DocType):
97+
class LocationDocument(Document):
9898
9999
# ...
100100
@@ -116,7 +116,7 @@ wish to index them by chunks of 20 thousands at once, specify the
116116

117117
.. code-block:: python
118118
119-
class LocationDocument(DocType):
119+
class LocationDocument(Document):
120120
121121
# ...
122122
@@ -153,7 +153,7 @@ settings (as already has been mentioned above).
153153
154154
# ...
155155
156-
class LocationDocument(DocType):
156+
class LocationDocument(Document):
157157
158158
# ...
159159

docs/more_like_this.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Sample document
1212
1313
from django.conf import settings
1414
15-
from django_elasticsearch_dsl import DocType, Index, fields
15+
from django_elasticsearch_dsl import Document, Index, fields
1616
from django_elasticsearch_dsl_drf.compat import KeywordField, StringField
1717
from django_elasticsearch_dsl_drf.analyzers import edge_ngram_completion
1818
@@ -31,7 +31,7 @@ Sample document
3131
3232
3333
@INDEX.doc_type
34-
class BookDocument(DocType):
34+
class BookDocument(Document):
3535
3636
# ID
3737
id = fields.IntegerField(attr='id')
@@ -69,7 +69,7 @@ Sample document
6969
class Meta(object):
7070
"""Meta options."""
7171
72-
model = Book # The model associate with this DocType
72+
model = Book # The model associate with this Document
7373
7474
def prepare_summary(self, instance):
7575
"""Prepare summary."""

docs/nested_fields_usage_examples.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ Document index
335335
336336
from django.conf import settings
337337
338-
from django_elasticsearch_dsl import DocType, Index, fields
338+
from django_elasticsearch_dsl import Document, Index, fields
339339
from django_elasticsearch_dsl_drf.compat import KeywordField, StringField
340340
341341
from books.models import Address
@@ -352,7 +352,7 @@ Document index
352352
)
353353
354354
@INDEX.doc_type
355-
class AddressDocument(DocType):
355+
class AddressDocument(Document):
356356
"""Address Elasticsearch document."""
357357
358358
# In different parts of the code different fields are used. There are
@@ -484,7 +484,7 @@ Document index
484484
class Meta(object):
485485
"""Meta options."""
486486
487-
model = Address # The model associate with this DocType
487+
model = Address # The model associate with this Document
488488
489489
Sample serializer
490490
-----------------
@@ -765,7 +765,7 @@ Sample document
765765
766766
from django.conf import settings
767767
768-
from django_elasticsearch_dsl import DocType, Index, fields
768+
from django_elasticsearch_dsl import Document, Index, fields
769769
from django_elasticsearch_dsl_drf.compat import KeywordField, StringField
770770
771771
from books.models import City
@@ -782,7 +782,7 @@ Sample document
782782
783783
784784
@INDEX.doc_type
785-
class CityDocument(DocType):
785+
class CityDocument(Document):
786786
"""City Elasticsearch document.
787787
788788
This document has been created purely for testing out complex fields.
@@ -847,7 +847,7 @@ Sample document
847847
class Meta(object):
848848
"""Meta options."""
849849
850-
model = City # The model associate with this DocType
850+
model = City # The model associate with this Document
851851
852852
Sample view
853853
+++++++++++

docs/quick_start.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ Required imports
393393
.. code-block:: python
394394
395395
from django.conf import settings
396-
from django_elasticsearch_dsl import DocType, Index, fields
396+
from django_elasticsearch_dsl import Document, Index, fields
397397
from elasticsearch_dsl import analyzer
398398
399399
from books.models import Book
@@ -488,7 +488,7 @@ Document definition
488488
.. code-block:: python
489489
490490
@INDEX.doc_type
491-
class BookDocument(DocType):
491+
class BookDocument(Document):
492492
"""Book Elasticsearch document."""
493493
494494
id = fields.IntegerField(attr='id')
@@ -557,7 +557,7 @@ Document definition
557557
class Meta(object):
558558
"""Meta options."""
559559
560-
model = Book # The model associate with this DocType
560+
model = Book # The model associate with this Document
561561
562562
Syncing Django's database with Elasticsearch indexes
563563
----------------------------------------------------
@@ -1081,7 +1081,7 @@ Change your development settings in the following way:
10811081

10821082
.. code-block:: python
10831083
1084-
MIDDLEWARE_CLASSES += (
1084+
MIDDLEWARE += (
10851085
'debug_toolbar.middleware.DebugToolbarMiddleware',
10861086
'debug_toolbar_force.middleware.ForceDebugToolbarMiddleware',
10871087
)

0 commit comments

Comments
 (0)