Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable pagination for search results #836

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

markusmo
Copy link

I encountered the problem, that there where always 10 results in my search-results-page. So I read the elasticsearch-dsl documentation and it stated, that elasticsearch always returns only 10 results at a time.

To paginate we would have to use python slice operator, but as pagination is done in the front-end, I return all the results by using search = search[0:search.count()] and then using search.to_queryset() which will result in a queryset containing all results found at a time.

Then the front-end is able to also paginate and show more than 10 results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant