barseghyanartur/django-elasticsearch-dsl-drf

LimitOffsetPagination count behavior

Closed this issue · 2 comments

Hello,

If you look a the snippet bellow from LimitOffsetPagination:

self.offset = self.get_offset(request)
self.request = request
resp = queryset[self.offset:self.offset + self.limit].execute()
self.facets = getattr(resp, 'aggregations', None)
self.count = self.get_es_count(resp)

We can see that the count id done after slicing the query set. So its not a total document count. Is this the intended behavior. (Note in Drf LimitOffsetPagination the count is done before)

Thanks

Did you actually test it? :) Please, try. If there are issues with the count, I'd love to fix them (but you won't find any). :)

Yes I tested it but it was the max_result_window :x