Answers.Body: <p>For filtering entries based on relationships (categories/assets/users/tags/other entries), you need to use the <code>relatedTo</code> parameter, not the <code>search</code> parameter.</p>
  
  <p>Here's an example: <a href="https://craftcms.stackexchange.com/questions/10321/filter-based-search-form">Filter based Search Form</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-19T11:54:05.000Z
Answers.Text: Thank you. Let me check
Answers.UserDisplayName: Rakhi Vijayan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-19T12:00:51.533Z
Answers.Text: can you please advice, what is this `.group('knowledge')` in query?
Answers.UserDisplayName: Rakhi Vijayan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-19T13:02:18.497Z
Answers.Text: That's simply outputting categories from a category group called 'knowledge'. It's not relevant to your question - you just need to use the `relatedTo` parameter instead of the `search` parameter as detailed in that question.
Answers.UserDisplayName: James Smith
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-20T11:37:48.427Z
Answers.Text: Thank you. `{% paginate craft.entries.section('blog').relatedTo('category:ui-ux OR category:healthcare').orderBy('postDate desc').limit(10) as pageInfo, entryTemplates %}`  . This not works for me, getting empty results.
Answers.UserDisplayName: Rakhi Vijayan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-20T15:04:56.613Z
Answers.Text: To use the `relatedTo` parameter you need to pass it either the category element(s), or the id(s) of the category/categories. See the docs: https://docs.craftcms.com/v3/relations.html#the-relatedto-parameter
Answers.UserDisplayName: James Smith
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-19T11:17:26.523Z
Answers.LastActivityDate: 2020-05-19T11:17:26.523Z
Answers.UserDisplayName: James Smith
Body: <p>I have a blog section with multi select categories. I want to filter all the blogs based on that multi select categories in the website. When I tried</p>
  
  <pre><code> .search('category:ui-ux OR category:web-designs')
  </code></pre>
  
  <p>the result blogs are not accurate. </p>
  
  <p>Category is a multi select field. So multiple category may assigned to one blog. I will list all these categories in my front end and need to filter blogs based on that.</p>
  
  <p>How I will do this search?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-19T07:30:17.847Z
Comments.Text: Is the field handle you are trying to search `category`?
Comments.UserDisplayName: Oli
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-19T09:54:40.003Z
Comments.Text: yes , the field handle of the multi select field that I added from admin is 'category'.
Comments.UserDisplayName: Rakhi Vijayan
Tags: <craft3><search><field><filter><category>
Title: How to search based on a Multi select category field in Craft 3?
ThreadText: # How to search based on a Multi select category field in Craft 3?
  
  (Asked by: username_0 on 2020-05-19)
  
  I have a blog section with multi select categories. I want to filter all the blogs based on that multi select categories in the website. When I tried
  
  ```
   .search('category:ui-ux OR category:web-designs')
  
  ```
  
  the result blogs are not accurate.
  
  Category is a multi select field. So multiple category may assigned to one blog. I will list all these categories in my front end and need to filter blogs based on that.
  
  How I will do this search?
  
  **Tags:** craft3, search, field, filter, category
  
  > **Comments:**
  > **username_1**: Is the field handle you are trying to search `category`?  
  > **username_0**: yes , the field handle of the multi select field that I added from admin is 'category'.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-05-19. Score: 1
  
  For filtering entries based on relationships (categories/assets/users/tags/other entries), you need to use the `relatedTo` parameter, not the `search` parameter.
  
  Here's an example: [Filter based Search Form](https://craftcms.stackexchange.com/questions/10321/filter-based-search-form)
  
  > **Comments:**
  > **username_0**: Thank you. Let me check  
  > **username_0**: can you please advice, what is this `.group('knowledge')` in query?  
  > **username_2**: That's simply outputting categories from a category group called 'knowledge'. It's not relevant to your question - you just need to use the `relatedTo` parameter instead of the `search` parameter as detailed in that question.  
  > **username_0**: Thank you. `{% paginate craft.entries.section('blog').relatedTo('category:ui-ux OR category:healthcare').orderBy('postDate desc').limit(10) as pageInfo, entryTemplates %}`  . This not works for me, getting empty results.  
  > **username_2**: To use the `relatedTo` parameter you need to pass it either the category element(s), or the id(s) of the category/categories. See the docs: https://docs.craftcms.com/v3/relations.html#the-relatedto-parameter  
  
  ---
  
  