Answers.Body: <p>The Entries Query only allows you to search one site at a time.  Here is the documentation for the <a href="https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#site" rel="nofollow noreferrer">Site Object</a> or <a href="https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#siteid" rel="nofollow noreferrer">Site Id</a> query params.</p>
  
  <p>You can get each site by:</p>
  
  <pre><code>{% set sites = craft.app.sites.allSites %}
  {% for site in sites %}
      …        
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-21T21:35:57.690Z
Answers.LastActivityDate: 2018-08-21T21:35:57.690Z
Answers.UserDisplayName: a-am
Answers.Body: <p>Currently, you unfortunately can't query all sites within your entires, you will have to separate your results out with a for-loop by site, as @aran did above. </p>
  
  <p>Craft 3.2 will thankfully fix this by allowing you to pass sites to an array or query sites('*') to return entries from all your sites:</p>
  
  <p><a href="https://github.com/craftcms/cms/commit/d01702278bd84b84392e11da72aa4d0b6f4f0943" rel="nofollow noreferrer">https://github.com/craftcms/cms/commit/d01702278bd84b84392e11da72aa4d0b6f4f0943</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-25T14:21:25.287Z
Answers.Text: You can now use `craft.entries().section('news').site('*')` https://github.com/craftcms/cms/issues/2854#issuecomment-471371467
Answers.UserDisplayName: Richard
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-18T21:35:07.877Z
Answers.LastActivityDate: 2019-03-18T21:35:07.877Z
Answers.UserDisplayName: sowings
Body: <p>I have a multisite setup and and a search bar at the top of each site. Currently it just searches within that site:</p>
  
  <pre><code>{% set theSite = craft.app.request.getSegment(1) %}
  {% paginate craft.entries.search(search).site(theSite).orderBy('score').limit(9) as pageInfo, pageEntries %}
  </code></pre>
  
  <p>The first segment defines the site.
  I need to expand the searches to include all entries in all sites. Is this possible? I tried variations of getAllSites and just .site but of course those didn't work.</p>
  
  <p>If its not possible to search all sites at once I may look at running each search and adding all of the results together.</p>
  
Tags: <search><multi-site>
Title: Search all Sites on Multisite
ThreadText: # Search all Sites on Multisite
  
  (Asked by: username_0 on 2018-08-21)
  
  I have a multisite setup and and a search bar at the top of each site. Currently it just searches within that site:
  
  ```
  {% set theSite = craft.app.request.getSegment(1) %}
  {% paginate craft.entries.search(search).site(theSite).orderBy('score').limit(9) as pageInfo, pageEntries %}
  
  ```
  
  The first segment defines the site.
  I need to expand the searches to include all entries in all sites. Is this possible? I tried variations of getAllSites and just .site but of course those didn't work.
  
  If its not possible to search all sites at once I may look at running each search and adding all of the results together.
  
  **Tags:** search, multi-site
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-08-21. Score: 1 | Accepted answer
  
  The Entries Query only allows you to search one site at a time. Here is the documentation for the [Site Object](https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#site) or [Site Id](https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#siteid) query params.
  
  You can get each site by:
  
  ```
  {% set sites = craft.app.sites.allSites %}
  {% for site in sites %}
      …        
  {% endfor %}
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2019-03-18. Score: 2
  
  Currently, you unfortunately can't query all sites within your entires, you will have to separate your results out with a for-loop by site, as @aran did above.
  
  Craft 3.2 will thankfully fix this by allowing you to pass sites to an array or query sites('\*') to return entries from all your sites:
  
  <https://github.com/craftcms/cms/commit/d01702278bd84b84392e11da72aa4d0b6f4f0943>
  
  > **Comments:**
  > **username_3**: You can now use `craft.entries().section('news').site('*')` https://github.com/craftcms/cms/issues/2854#issuecomment-471371467  
  
  ---
  
  