<p>I would consider using <a href="https://craftcms.com/docs/searching" rel="nofollow">Search</a> because it already orders by relevance. You could define the search query using the tags. Make sense? </p>

CC BY-SA 3.0
2016-06-28T14:39:36.377Z
When this question was asked I don't think the `score` parameter was available, but this has been the option we have been using since that Craft update!
Mike Vaux
CC BY-SA 3.0
2016-06-28T14:40:21.433Z
Nice Mike! Glad you have a solution.
Matt P
CC BY-SA 3.0
2016-03-30T14:41:16.340Z
2016-03-30T14:41:16.340Z
Matt P
<p>I've made a plugin called <a href="https://github.com/aelvan/Similar-Craft" rel="nofollow">Similar</a> that does exactly this. Give it a go.</p>

CC BY-SA 3.0
2016-03-30T15:17:08.150Z
2016-03-30T15:17:08.150Z
André Elvan
<p>I have a set of entries which each have 0 or more tags (no limit). For each entry, I am aiming to display 3 'related entries', related by the tags field.</p>

<p>e.g. If entry 1 is tagged with 'apples', 'bananas' and 'pears', then the first results returned would be entries with all 3 tags, followed by 2, followed by just one, then those with none of the tags.</p>

<p>Is this possible? I can't see anything in the documentation about ordering by relevance of the 'relatedTo' parameter.</p>

<entries><relations><tags><sorting>
Is it possible to order related entries by relevance of tags?
# Is it possible to order related entries by relevance of tags?

(Asked by: username_0 on 2015-08-25)

I have a set of entries which each have 0 or more tags (no limit). For each entry, I am aiming to display 3 'related entries', related by the tags field.

e.g. If entry 1 is tagged with 'apples', 'bananas' and 'pears', then the first results returned would be entries with all 3 tags, followed by 2, followed by just one, then those with none of the tags.

Is this possible? I can't see anything in the documentation about ordering by relevance of the 'relatedTo' parameter.

**Tags:** entries, relations, tags, sorting


---

## 2 answers

### Answer by username_1 on 2016-03-30. Score: 1 | Accepted answer

I would consider using [Search](https://craftcms.com/docs/searching) because it already orders by relevance. You could define the search query using the tags. Make sense?

> **Comments:**
> **username_0**: When this question was asked I don't think the `score` parameter was available, but this has been the option we have been using since that Craft update!  
> **username_1**: Nice Mike! Glad you have a solution.  

---

### Answer by username_2 on 2016-03-30. Score: 2

I've made a plugin called [Similar](https://github.com/aelvan/Similar-Craft) that does exactly this. Give it a go.


---

