Answers.Body: <p>I think this will work   </p>
  
  <pre><code>{{ paginate.prevUrl }}?search=' ~ (craft.request.getParam('search'))
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-01T11:40:54.393Z
Answers.Text: Thanks. I used {{ paginate.nextUrl }}?q={{ query }} and that worked with my setup.
Answers.UserDisplayName: James
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-01T11:29:34.917Z
Answers.LastActivityDate: 2014-07-01T11:29:34.917Z
Answers.UserDisplayName: sneeky
Answers.Body: <p><code>{{ paginate.nextUrl }}?q={{ query }}</code> did the trick with this setup.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-08T09:20:57.847Z
Answers.LastActivityDate: 2014-12-08T14:35:27.760Z
Answers.LastEditDate: 2014-12-08T14:35:27.760Z
Answers.UserDisplayName: James
Body: <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>
  
Tags: <pagination><search>
Title: How to paginate search results?
ThreadText: # 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.  
  
  ---
  
  