diff --git a/docs/topics/search/searching.rst b/docs/topics/search/searching.rst
index 3a9de7b18b..421d57301d 100644
--- a/docs/topics/search/searching.rst
+++ b/docs/topics/search/searching.rst
@@ -36,14 +36,13 @@ All methods of ``PageQuerySet`` are supported by ``wagtailsearch``:
An example page search view
===========================
-You can add a "Search" page to your site using a Django view. Here's an example that you can use:
+Here's an example Django view that could be used to add a "search" page to your site:
.. code-block:: python
# views.py
from django.shortcuts import render
- from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.models import Query
@@ -60,16 +59,6 @@ You can add a "Search" page to your site using a Django view. Here's an example
else:
search_results = Page.objects.none()
- # Pagination
- page = request.GET.get('page', 1)
- paginator = Paginator(search_results, 10)
- try:
- search_results = paginator.page(page)
- except PageNotAnInteger:
- search_results = paginator.page(1)
- except EmptyPage:
- search_results = paginator.page(paginator.num_pages)
-
# Render template
return render(request, 'search_results.html', {
'search_query': search_query,
@@ -103,14 +92,6 @@ And here's a template to go with it:
{% endfor %}
-
- {% if search_results.has_previous %}
- Previous
- {% endif %}
-
- {% if search_results.has_next %}
- Next
- {% endif %}
{% elif search_query %}
No results found
{% else %}