Answers.Body: <p>The paginate tag requires an element query to work and by calling <code>.all()</code> on your queries, you've turned them into an array of elements.</p>
  
  <p>Something like this should work:</p>
  
  <pre><code>{# Grab all of the IDs #}
  {% set entries = craft.entries.section('not loanConsultants').search(searchQuery).ids() %}
  
  {% set loanConsultants = craft.entries.section('loanConsultants').type('loanConsultants').search('title:'~searchQuery).ids() %}
  
  {% set branch =   craft.entries.section('loanConsultants').type('branches').search('title:'~searchQuery).ids() %}
  
  {# Merge the IDs together #}
  {% set loanConsultantsMerge = loanConsultants|merge(branch) %}
  {% set mergeResults = loanConsultantsMerge|merge(entries) %}
  
  {# Build new query #}
  {% set results = craft.entries.id($mergeResults) %}
  
  {% paginate results as pageInfo, pageEntries %}
  {% for entry in pageEntries %}
      &lt;h5&gt;{{ entry.title }}&lt;/h5&gt;
  {% endfor %}
  
  {% if pageInfo.prevUrl %}&lt;a href="{{ pageInfo.prevUrl }}" class="btn btn-success" style="color: blue;"&gt;Previous Page&lt;/a&gt;{% endif %}
  
  {% if pageInfo.nextUrl %}&lt;a href="{{ pageInfo.nextUrl }}" class="btn btn-success" style="color: blue;"&gt;Next Page&lt;/a&gt;{% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-16T22:01:46.407Z
Answers.LastActivityDate: 2019-10-16T22:01:46.407Z
Answers.UserDisplayName: Brad Bell
Body: <p>My Code:</p>
  
  <pre><code>{% set Entries              =   craft.entries.section('not loanConsultants').search(searchQuery).orderBy('dateCreated desc').all() %}
  
  {% set loanConsultants      =   craft.entries.section('loanConsultants').type('loanConsultants').search('title:'~searchQuery).orderBy('dateCreated desc').all() %}
  
  {% set Branch               =   craft.entries.section('loanConsultants').type('branches').search('title:'~searchQuery).orderBy('dateCreated desc').all() %}
  
  {% set loanConsultantsMerge = loanConsultants|merge(Branch) %}
  
  {% set mergeResults         = loanConsultantsMerge|merge(Entries) %}
  </code></pre>
  
  <p>Pagination code:</p>
  
  <pre><code>{% paginate mergeResults as pageInfo, pageEntries %}
  {% for entry in pageEntries %}
      &lt;h5&gt;{{ entry.title }}&lt;/h5&gt;
  {% endfor %}
  
  {% if pageInfo.prevUrl %}&lt;a href="{{ pageInfo.prevUrl }}" class="btn btn-success" style="color: blue;"&gt;Previous Page&lt;/a&gt;{% endif %}
  
  {% if pageInfo.nextUrl %}&lt;a href="{{ pageInfo.nextUrl }}" class="btn btn-success" style="color: blue;"&gt;Next Page&lt;/a&gt;{% endif %}
  </code></pre>
  
Tags: <craft3>
Title: Craft paginate not working in merge Queries
ThreadText: # Craft paginate not working in merge Queries
  
  (Asked by: username_0 on 2019-10-16)
  
  My Code:
  
  ```
  {% set Entries              =   craft.entries.section('not loanConsultants').search(searchQuery).orderBy('dateCreated desc').all() %}
  
  {% set loanConsultants      =   craft.entries.section('loanConsultants').type('loanConsultants').search('title:'~searchQuery).orderBy('dateCreated desc').all() %}
  
  {% set Branch               =   craft.entries.section('loanConsultants').type('branches').search('title:'~searchQuery).orderBy('dateCreated desc').all() %}
  
  {% set loanConsultantsMerge = loanConsultants|merge(Branch) %}
  
  {% set mergeResults         = loanConsultantsMerge|merge(Entries) %}
  
  ```
  
  Pagination code:
  
  ```
  {% paginate mergeResults as pageInfo, pageEntries %}
  {% for entry in pageEntries %}
      <h5>{{ entry.title }}</h5>
  {% endfor %}
  
  {% if pageInfo.prevUrl %}<a href="{{ pageInfo.prevUrl }}" class="btn btn-success" style="color: blue;">Previous Page</a>{% endif %}
  
  {% if pageInfo.nextUrl %}<a href="{{ pageInfo.nextUrl }}" class="btn btn-success" style="color: blue;">Next Page</a>{% endif %}
  
  ```
  
  **Tags:** craft3
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-10-16. Score: 2 | Accepted answer
  
  The paginate tag requires an element query to work and by calling `.all()` on your queries, you've turned them into an array of elements.
  
  Something like this should work:
  
  ```
  {# Grab all of the IDs #}
  {% set entries = craft.entries.section('not loanConsultants').search(searchQuery).ids() %}
  
  {% set loanConsultants = craft.entries.section('loanConsultants').type('loanConsultants').search('title:'~searchQuery).ids() %}
  
  {% set branch =   craft.entries.section('loanConsultants').type('branches').search('title:'~searchQuery).ids() %}
  
  {# Merge the IDs together #}
  {% set loanConsultantsMerge = loanConsultants|merge(branch) %}
  {% set mergeResults = loanConsultantsMerge|merge(entries) %}
  
  {# Build new query #}
  {% set results = craft.entries.id($mergeResults) %}
  
  {% paginate results as pageInfo, pageEntries %}
  {% for entry in pageEntries %}
      <h5>{{ entry.title }}</h5>
  {% endfor %}
  
  {% if pageInfo.prevUrl %}<a href="{{ pageInfo.prevUrl }}" class="btn btn-success" style="color: blue;">Previous Page</a>{% endif %}
  
  {% if pageInfo.nextUrl %}<a href="{{ pageInfo.nextUrl }}" class="btn btn-success" style="color: blue;">Next Page</a>{% endif %}
  
  ```
  
  
  ---
  
  