Skip to content

Commit

Permalink
Added support for django-elasticsearch-dsl 6.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
noamkush committed Jul 28, 2019
1 parent 006bf89 commit 6746957
Show file tree
Hide file tree
Showing 29 changed files with 118 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ matrix:
python: 3.7

before_install:
- 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
- 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

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

Expand Down
28 changes: 14 additions & 14 deletions docs/advanced_usage_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Document index
.. code-block:: python
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from elasticsearch_dsl import analyzer
from books.models import Book
Expand All @@ -257,7 +257,7 @@ Document index
@INDEX.doc_type
class BookDocument(DocType):
class BookDocument(Document):
"""Book Elasticsearch document."""
id = fields.IntegerField(attr='id')
Expand Down Expand Up @@ -326,7 +326,7 @@ Document index
class Meta(object):
"""Meta options."""
model = Book # The model associate with this DocType
model = Book # The model associate with this Document
Sample serializer
-----------------
Expand Down Expand Up @@ -964,7 +964,7 @@ documents using ``fields.CompletionField``.
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from books.models import Publisher
Expand All @@ -979,7 +979,7 @@ documents using ``fields.CompletionField``.
@INDEX.doc_type
class PublisherDocument(DocType):
class PublisherDocument(Document):
"""Publisher Elasticsearch document."""
id = fields.IntegerField(attr='id')
Expand Down Expand Up @@ -1028,7 +1028,7 @@ documents using ``fields.CompletionField``.
class Meta(object):
"""Meta options."""
model = Publisher # The model associate with this DocType
model = Publisher # The model associate with this Document
After that the ``name.suggest``, ``city.suggest``, ``state_province.suggest``
and ``country.suggest`` fields would be available for suggestions feature.
Expand Down Expand Up @@ -1324,7 +1324,7 @@ In that case, the document definition should be altered as follows:

.. code-block:: python
class BookDocument(DocType):
class BookDocument(Document):
# ...
Expand Down Expand Up @@ -1418,7 +1418,7 @@ In that case, the document definition should be altered as follows:

.. code-block:: python
class AddressDocument(DocType):
class AddressDocument(Document):
# ...
Expand Down Expand Up @@ -1513,7 +1513,7 @@ Document definition
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from books.models import Book
Expand All @@ -1527,7 +1527,7 @@ Document definition
)
@INDEX.doc_type
class BookDocument(DocType):
class BookDocument(Document):
"""Book Elasticsearch document."""
# ID
id = fields.IntegerField(attr='id')
Expand Down Expand Up @@ -1608,7 +1608,7 @@ Document definition
class Meta(object):
"""Meta options."""
model = Book # The model associate with this DocType
model = Book # The model associate with this Document
ViewSet definition
^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -2022,7 +2022,7 @@ The following example indicates Ngram analyzer/filter usage.
.. code-block:: python
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from elasticsearch_dsl import analyzer
from elasticsearch_dsl.analysis import token_filter
Expand Down Expand Up @@ -2052,7 +2052,7 @@ The following example indicates Ngram analyzer/filter usage.
)
@INDEX.doc_type
class BookDocument(DocType):
class BookDocument(Document):
"""Book Elasticsearch document."""
# In different parts of the code different fields are used. There are
Expand Down Expand Up @@ -2083,7 +2083,7 @@ The following example indicates Ngram analyzer/filter usage.
class Meta(object):
"""Meta options."""
model = Book # The model associate with this DocType
model = Book # The model associate with this Document
ViewSet definition
~~~~~~~~~~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions docs/basic_usage_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Sample document

.. code-block:: python
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from elasticsearch_dsl import analyzer
from books.models import Publisher
Expand All @@ -92,7 +92,7 @@ Sample document
@PUBLISHER_INDEX.doc_type
class PublisherDocument(DocType):
class PublisherDocument(Document):
"""Publisher Elasticsearch document."""
id = fields.IntegerField(attr='id')
Expand Down Expand Up @@ -135,7 +135,7 @@ Sample document
class Meta(object):
"""Meta options."""
model = Publisher # The model associate with this DocType
model = Publisher # The model associate with this Document
Sample serializer
Expand Down
6 changes: 3 additions & 3 deletions docs/indexing_troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ document meta.

.. code-block:: python
class LocationDocument(DocType):
class LocationDocument(Document):
# ...
Expand All @@ -116,7 +116,7 @@ wish to index them by chunks of 20 thousands at once, specify the

.. code-block:: python
class LocationDocument(DocType):
class LocationDocument(Document):
# ...
Expand Down Expand Up @@ -153,7 +153,7 @@ settings (as already has been mentioned above).
# ...
class LocationDocument(DocType):
class LocationDocument(Document):
# ...
Expand Down
6 changes: 3 additions & 3 deletions docs/more_like_this.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Sample document
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from django_elasticsearch_dsl_drf.compat import KeywordField, StringField
from django_elasticsearch_dsl_drf.analyzers import edge_ngram_completion
Expand All @@ -31,7 +31,7 @@ Sample document
@INDEX.doc_type
class BookDocument(DocType):
class BookDocument(Document):
# ID
id = fields.IntegerField(attr='id')
Expand Down Expand Up @@ -69,7 +69,7 @@ Sample document
class Meta(object):
"""Meta options."""
model = Book # The model associate with this DocType
model = Book # The model associate with this Document
def prepare_summary(self, instance):
"""Prepare summary."""
Expand Down
12 changes: 6 additions & 6 deletions docs/nested_fields_usage_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Document index
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from django_elasticsearch_dsl_drf.compat import KeywordField, StringField
from books.models import Address
Expand All @@ -352,7 +352,7 @@ Document index
)
@INDEX.doc_type
class AddressDocument(DocType):
class AddressDocument(Document):
"""Address Elasticsearch document."""
# In different parts of the code different fields are used. There are
Expand Down Expand Up @@ -484,7 +484,7 @@ Document index
class Meta(object):
"""Meta options."""
model = Address # The model associate with this DocType
model = Address # The model associate with this Document
Sample serializer
-----------------
Expand Down Expand Up @@ -765,7 +765,7 @@ Sample document
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from django_elasticsearch_dsl_drf.compat import KeywordField, StringField
from books.models import City
Expand All @@ -782,7 +782,7 @@ Sample document
@INDEX.doc_type
class CityDocument(DocType):
class CityDocument(Document):
"""City Elasticsearch document.
This document has been created purely for testing out complex fields.
Expand Down Expand Up @@ -847,7 +847,7 @@ Sample document
class Meta(object):
"""Meta options."""
model = City # The model associate with this DocType
model = City # The model associate with this Document
Sample view
+++++++++++
Expand Down
8 changes: 4 additions & 4 deletions docs/quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ Required imports
.. code-block:: python
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from elasticsearch_dsl import analyzer
from books.models import Book
Expand Down Expand Up @@ -488,7 +488,7 @@ Document definition
.. code-block:: python
@INDEX.doc_type
class BookDocument(DocType):
class BookDocument(Document):
"""Book Elasticsearch document."""
id = fields.IntegerField(attr='id')
Expand Down Expand Up @@ -557,7 +557,7 @@ Document definition
class Meta(object):
"""Meta options."""
model = Book # The model associate with this DocType
model = Book # The model associate with this Document
Syncing Django's database with Elasticsearch indexes
----------------------------------------------------
Expand Down Expand Up @@ -1081,7 +1081,7 @@ Change your development settings in the following way:

.. code-block:: python
MIDDLEWARE_CLASSES += (
MIDDLEWARE += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
'debug_toolbar_force.middleware.ForceDebugToolbarMiddleware',
)
Expand Down
Loading

0 comments on commit 6746957

Please sign in to comment.