Answers.Body: <p>Give this a go:</p>
  
  <pre><code>{% set searchTerm = craft.request.getParam('q') %}    
  {% set query = craft.entries({
          search: 'title:*' ~ searchTerm ~ '*',
          limit: 5,
          locale: craft.locale,
          order: 'score'
      }) %}
  </code></pre>
  
  <p>You can leave out the <code>*</code> on both sides if you only want to search for full word matches. Also, this might help you take it further: <a href="https://craftcms.com/docs/searching" rel="nofollow noreferrer">https://craftcms.com/docs/searching</a> </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-05T12:10:08.727Z
Answers.Text: That did the trick. Couldn't figure it out straight from the docs though.
Answers.UserDisplayName: Justin Dekkers
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-05T11:00:02.180Z
Answers.LastActivityDate: 2017-05-05T11:00:02.180Z
Answers.UserDisplayName: ijust
Body: <p>I have a vacancy's website which has a couple of search forms spread around the website. The craft standard search form works great, the only problem is I need to search only by the <strong>title field</strong> instead of all the content in the entries. </p>
  
  <p>So my question is..</p>
  
  <p><strong>Is it possible to search only by title field?</strong></p>
  
Tags: <templating><search>
Title: Search only by Field instead of entire content
ThreadText: # Search only by Field instead of entire content
  
  (Asked by: username_0 on 2017-05-05)
  
  I have a vacancy's website which has a couple of search forms spread around the website. The craft standard search form works great, the only problem is I need to search only by the **title field** instead of all the content in the entries.
  
  So my question is..
  
  **Is it possible to search only by title field?**
  
  **Tags:** templating, search
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-05-05. Score: 3 | Accepted answer
  
  Give this a go:
  
  ```
  {% set searchTerm = craft.request.getParam('q') %}    
  {% set query = craft.entries({
          search: 'title:*' ~ searchTerm ~ '*',
          limit: 5,
          locale: craft.locale,
          order: 'score'
      }) %}
  
  ```
  
  You can leave out the `*` on both sides if you only want to search for full word matches. Also, this might help you take it further: <https://craftcms.com/docs/searching>
  
  > **Comments:**
  > **username_0**: That did the trick. Couldn't figure it out straight from the docs though.  
  
  ---
  
  