Answers.Body: <p>Search via <code>search()</code> can be used only for text fields, if you want to search by categories or records you need to use the <code>relatedTo()</code> method, also do not forget to specify search keywords when creating the field.</p>
  <p><a href="https://i.sstatic.net/5KPLW.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5KPLW.png" alt="enter image description here" /></a></p>
  <p>Links: <a href="https://craftcms.com/docs/3.x/relations.html#terminology" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/relations.html#terminology</a>, <a href="https://craftcms.com/docs/3.x/searching.html#supported-syntaxes" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/searching.html#supported-syntaxes</a>.</p>
  <p>Practical example:</p>
  <pre><code>{% set searchResults = [] %}
    
  {% set queryParamsText = queryParamsText|merge({
          search: {
              query: 'title:' ~ searchWord
          }
       }) 
  %}
  
      {% set category = craft.categories.group('category').search(searchWord).one() %}
  
      {% set relatedParams = relatedParams|merge([{ targetElement:category }]) %}
  
      {% if relatedParams|length &gt; 1 %}
          {% set queryParamsRelated = queryParamsRelated|merge({'relatedTo':relatedParams}) %}
      {% endif %}
  
  {% set searchResultsText = craft.entries(queryParamsText).section('canAddSectionHandleOrId') %}
  
  {% set searchResultsRelated = craft.entries(queryParamsRelated
  ).section('canAddSectionHandleOrId') %}
  
  {% set searchResults = searchResultsText|merge(searchResultsRelated)|unique %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-07T17:07:18.057Z
Answers.Text: Hi Pavel, thanks for your response.
  Question: Can´t i search text con category title or tags title? Docs says that i can search on those attributes.
  And matrix fields with Redactor rich text?
Answers.UserDisplayName: Sebastián.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-07T17:13:02.810Z
Answers.Text: I will try your solution and check in deep the links, thank you!
Answers.UserDisplayName: Sebastián.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-07T18:12:01.787Z
Answers.Text: @Sebastián. It's my pleasure. In a text search, you will search for your category titles and reach text, Craft CMS will give you the essence where this text appears.
Answers.UserDisplayName: Pavel Pavlovich
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-05T19:25:25.710Z
Answers.LastActivityDate: 2020-10-05T19:25:25.710Z
Answers.UserDisplayName: Pavel Pavlovich
Body: <p>I´m doing a search on Blog entries, i want to get all relevant entries searching on several fields, and seems that only matches the title. I try already using search(query), now i added the fields, same result. Maybe the search item should be re-generated? i don´t know how to do it in console, but i have only 4 blog entries at the time, i already change and saved all of them, same result...</p>
  <p>Any help is welcome. Thanks.</p>
  <pre><code>{% paginate craft.entries({
               search: 'title:' ~ query ~ ' OR categoriaBlog:' ~ query ~ ' OR etiquetasBlog:' ~ query ~ ' OR resumenBlog:' ~ query ~ ' OR subtituloBlog:' ~ query ~ ' OR contenidoBlog:' ~ query,
               orderBy: 'score',
               section: 'blogSec'
          })
          .limit(6) as pageInfo, blogs %}
  </code></pre>
  
Tags: <craft3><search>
Title: Craft search only shows results matching 'title' of entries
ThreadText: # Craft search only shows results matching 'title' of entries
  
  (Asked by: username_0 on 2020-10-05)
  
  I´m doing a search on Blog entries, i want to get all relevant entries searching on several fields, and seems that only matches the title. I try already using search(query), now i added the fields, same result. Maybe the search item should be re-generated? i don´t know how to do it in console, but i have only 4 blog entries at the time, i already change and saved all of them, same result...
  
  Any help is welcome. Thanks.
  
  ```
  {% paginate craft.entries({
               search: 'title:' ~ query ~ ' OR categoriaBlog:' ~ query ~ ' OR etiquetasBlog:' ~ query ~ ' OR resumenBlog:' ~ query ~ ' OR subtituloBlog:' ~ query ~ ' OR contenidoBlog:' ~ query,
               orderBy: 'score',
               section: 'blogSec'
          })
          .limit(6) as pageInfo, blogs %}
  
  ```
  
  **Tags:** craft3, search
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-10-05. Score: 2
  
  Search via `search()` can be used only for text fields, if you want to search by categories or records you need to use the `relatedTo()` method, also do not forget to specify search keywords when creating the field.
  
  [![enter image description here](https://i.sstatic.net/5KPLW.png)](https://i.sstatic.net/5KPLW.png)
  
  Links: <https://craftcms.com/docs/3.x/relations.html#terminology>, <https://craftcms.com/docs/3.x/searching.html#supported-syntaxes>.
  
  Practical example:
  
  ```
  {% set searchResults = [] %}
    
  {% set queryParamsText = queryParamsText|merge({
          search: {
              query: 'title:' ~ searchWord
          }
       }) 
  %}
  
      {% set category = craft.categories.group('category').search(searchWord).one() %}
  
      {% set relatedParams = relatedParams|merge([{ targetElement:category }]) %}
  
      {% if relatedParams|length > 1 %}
          {% set queryParamsRelated = queryParamsRelated|merge({'relatedTo':relatedParams}) %}
      {% endif %}
  
  {% set searchResultsText = craft.entries(queryParamsText).section('canAddSectionHandleOrId') %}
  
  {% set searchResultsRelated = craft.entries(queryParamsRelated
  ).section('canAddSectionHandleOrId') %}
  
  {% set searchResults = searchResultsText|merge(searchResultsRelated)|unique %}
  
  ```
  
  > **Comments:**
  > **username_0**: Hi username_1, thanks for your response. Question: Can´t i search text con category title or tags title? Docs says that i can search on those attributes. And matrix fields with Redactor rich text?  
  > **username_0**: I will try your solution and check in deep the links, thank you!  
  > **username_1**: @username_0. It's my pleasure. In a text search, you will search for your category titles and reach text, Craft CMS will give you the essence where this text appears.  
  
  ---
  
  