Skip to content

Commit e8e7a37

Browse files
Merge pull request #31 from rrmerugu/master
fixes to automatically use doc_type in the viewsets
2 parents 87cc858 + 0849de3 commit e8e7a37

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/django_elasticsearch_dsl_drf/viewsets.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from .pagination import PageNumberPagination
1919
from .utils import DictionaryProxy
2020

21-
2221
__title__ = 'django_elasticsearch_dsl_drf.viewsets'
2322
__author__ = 'Artur Barseghyan <[email protected]>'
2423
__copyright__ = '2017-2018 Artur Barseghyan'
@@ -39,7 +38,7 @@ def __init__(self, *args, **kwargs):
3938
self.client = connections.get_connection()
4039
self.index = self.document._doc_type.index
4140
self.mapping = self.document._doc_type.mapping.properties.name
42-
self.search = Search(using=self.client, index=self.index)
41+
self.search = Search(using=self.client, index=self.index, doc_type=self.document._doc_type.name)
4342
super(BaseDocumentViewSet, self).__init__(*args, **kwargs)
4443

4544
def get_queryset(self):

0 commit comments

Comments
 (0)