Answers.Body: <p>I don't think the accepted answer actually works, <code>order: 'score'</code> only works if you are doing a search. </p>
  
  <p>I've made a plugin called <a href="https://github.com/aelvan/Similar-Craft" rel="nofollow">Similar</a> that orders by the number of relations to other element types, like tags.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-30T15:25:38.087Z
Answers.LastActivityDate: 2016-03-30T15:25:38.087Z
Answers.UserDisplayName: André Elvan
Answers.Body: <p>This should work:</p>
  
  <pre><code>{% set tags = entry.q_tags %}
  {% set entries = craft.entries.relatedTo(tags).order('score').find() %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-23T17:45:34.697Z
Answers.Text: How would you stop the current entry from displaying as a related entry?
Answers.UserDisplayName: Steven Grant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-24T08:16:42.087Z
Answers.Text: Try adding .id('not ' ~ entry.id) to your criteria.
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-06T19:30:25.333Z
Answers.Text: Ordering by `'score'` only works in the context of doing a `search: 'something'`.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-18T10:29:24.393Z
Answers.Text: Do you not want to pass an array in this situation? I.e. omit the `.first` to make `{% set tags = entry.q_tags %}` and then just pass that to the relatedTo param.
Answers.UserDisplayName: Josh Angell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-18T11:05:22.240Z
Answers.Text: Didn't notice the 'first' :)
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-18T10:24:50.940Z
Answers.LastActivityDate: 2014-07-18T11:04:57.930Z
Answers.LastEditDate: 2014-07-18T11:04:57.930Z
Answers.UserDisplayName: Paul
Answers.Body: <p>Here's how you would exclude the current entry from showing within that output if so desired</p>
  
  <pre><code>{% set entries = craft.entries({
    relatedTo:      tags,
    order:          'score',
    limit:           4,
    id:             'not ' ~ entry.id
  }) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-06T19:30:13.113Z
Answers.Text: Ordering by `'score'` only works in the context of doing a `search: 'something'`.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-23T17:56:02.943Z
Answers.LastActivityDate: 2015-02-23T17:56:02.943Z
Answers.UserDisplayName: Steven Grant
Body: <p>On an entry page I search for related entries based on the tags assigned to the respective entry. The following example works:</p>
  
  <pre><code>{% set tags = entry.q_tags.first %}
  
  {% for tag in entry.q_tags.offset(1) %}
      {% set tags = tags ~ ' OR ' ~ tag  %}
  {% endfor %}
  
  {% set entries = craft.entries.search(tags).order('score') %}
  </code></pre>
  
  <p>I just wonder whether there is a smarter solution?</p>
  
Tags: <tags><search>
Title: Search for related entries based on tags
ThreadText: # Search for related entries based on tags
  
  (Asked by: username_0 on 2014-07-18)
  
  On an entry page I search for related entries based on the tags assigned to the respective entry. The following example works:
  
  ```
  {% set tags = entry.q_tags.first %}
  
  {% for tag in entry.q_tags.offset(1) %}
      {% set tags = tags ~ ' OR ' ~ tag  %}
  {% endfor %}
  
  {% set entries = craft.entries.search(tags).order('score') %}
  
  ```
  
  I just wonder whether there is a smarter solution?
  
  **Tags:** tags, search
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-03-30. Score: 1 | Accepted answer
  
  I don't think the accepted answer actually works, `order: 'score'` only works if you are doing a search.
  
  I've made a plugin called [Similar](https://github.com/aelvan/Similar-Craft) that orders by the number of relations to other element types, like tags.
  
  
  ---
  
  ### Answer by username_2 on 2014-07-18. Score: 5
  
  This should work:
  
  ```
  {% set tags = entry.q_tags %}
  {% set entries = craft.entries.relatedTo(tags).order('score').find() %}
  
  ```
  
  > **Comments:**
  > **username_5**: Do you not want to pass an array in this situation? I.e. omit the `.first` to make `{% set tags = entry.q_tags %}` and then just pass that to the relatedTo param.  
  > **username_2**: Didn't notice the 'first' :)  
  > **username_3**: How would you stop the current entry from displaying as a related entry?  
  > **username_2**: Try adding .id('not ' ~ entry.id) to your criteria.  
  > **username_4**: Ordering by `'score'` only works in the context of doing a `search: 'something'`.  
  
  ---
  
  ### Answer by username_3 on 2015-02-23. Score: 4
  
  Here's how you would exclude the current entry from showing within that output if so desired
  
  ```
  {% set entries = craft.entries({
    relatedTo:      tags,
    order:          'score',
    limit:           4,
    id:             'not ' ~ entry.id
  }) %}
  
  ```
  
  > **Comments:**
  > **username_4**: Ordering by `'score'` only works in the context of doing a `search: 'something'`.  
  
  ---
  
  