Answers.Body: <p>This seems to work:</p>
  
  <pre><code>{% set entries = craft.entries.section('not lakeDetails').search('title:' ~ query).order('score') %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-02T12:04:26.933Z
Answers.LastActivityDate: 2014-10-02T12:04:26.933Z
Answers.UserDisplayName: user1070143
Body: <p>How do I change this template code to only return results from the <em>title</em> field of an entry?</p>
  
  <p>The search result page url would look like this: <code>/search-results?q=joe+blogs</code></p>
  
  <pre><code>{% set query = craft.request.getParam('q') %}
  {% set entries = craft.entries.section('not thisSection').search(query).order('score') %}
  </code></pre>
  
  <p>Thanks for any help.</p>
  
Tags: <templating><search>
Title: How to search by title field only?
ThreadText: # How to search by title field only?
  
  (Asked by: username_0 on 2014-10-02)
  
  How do I change this template code to only return results from the *title* field of an entry?
  
  The search result page url would look like this: `/search-results?q=joe+blogs`
  
  ```
  {% set query = craft.request.getParam('q') %}
  {% set entries = craft.entries.section('not thisSection').search(query).order('score') %}
  
  ```
  
  Thanks for any help.
  
  **Tags:** templating, search
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-10-02. Score: 6 | Accepted answer
  
  This seems to work:
  
  ```
  {% set entries = craft.entries.section('not lakeDetails').search('title:' ~ query).order('score') %}
  
  ```
  
  
  ---
  
  