Skip to content

enable pagination for search results#836

Open
markusmo wants to merge 2 commits into
awesto:masterfrom
markusmo:bugfix/elasticsearch-dsl-search-page-pagination
Open

enable pagination for search results#836
markusmo wants to merge 2 commits into
awesto:masterfrom
markusmo:bugfix/elasticsearch-dsl-search-page-pagination

Conversation

@markusmo

Copy link
Copy Markdown

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.

1 participant