<p>I think this will work   </p>

<pre><code>{{ paginate.prevUrl }}?search=' ~ (craft.request.getParam('search'))
</code></pre>

CC BY-SA 3.0
2014-07-01T11:40:54.393Z
Thanks. I used {{ paginate.nextUrl }}?q={{ query }} and that worked with my setup.
James
CC BY-SA 3.0
2014-07-01T11:29:34.917Z
2014-07-01T11:29:34.917Z
sneeky
<p><code>{{ paginate.nextUrl }}?q={{ query }}</code> did the trick with this setup.</p>

CC BY-SA 3.0
2014-07-08T09:20:57.847Z
2014-12-08T14:35:27.760Z
2014-12-08T14:35:27.760Z
James
<p>What’s the best way to paginate search results?</p>

<p>I was using</p>

<pre><code>{% set query = craft.request.getParam('q') %}
</code></pre>

<p>and then</p>

<pre><code>{% paginate craft.entries.search(query).section('…').limit(…).order('…') as entries %}
</code></pre>

<p>but the pagination links (paginate.prevUrl and paginate.nextUrl) don’t contain the query.</p>

<pagination><search>
How to paginate search results?
# How to paginate search results?

(Asked by: username_0 on 2014-07-01)

What’s the best way to paginate search results?
I was using
{% set query = craft.request.getParam('q') %}

and then
{% paginate craft.entries.search(query).section('…').limit(…).order('…') as entries %}

but the pagination links (paginate.prevUrl and paginate.nextUrl) don’t contain the query.

**Tags:** pagination, search


---

## 2 answers

### Answer by username_0 on 2014-07-08. Score: 15 | Accepted answer

`{{ paginate.nextUrl }}?q={{ query }}` did the trick with this setup.


---

### Answer by username_1 on 2014-07-01. Score: 3

I think this will work   
{{ paginate.prevUrl }}?search=' ~ (craft.request.getParam('search'))

> **Comments:**
> **username_0**: Thanks. I used {{ paginate.nextUrl }}?q={{ query }} and that worked with my setup.  

---

