Most related articles I am using the normal relatedTo property to find related articles, but I have an issue which is:

craft.entries.section('section').relatedTo("tags").id('not ' ~ entry.id).limit(3)


Lets say THIS article has 2 tags: "cat" and "animal", 
then I use the normal relatedTo property to get related articles. 
Lets say i want three articles

Sometimes I get these three:


article 1 (tags: "dog" and "animal")
article 2 (tags: "cat" and "food")
article 3 (tags: "mouse" and "animal")


But not this one:


article 4 (tags: "cat" and "animal")


How can i get the MOST related articles always? I want the one that has the most matching tags, not just random ones that has at least 1 tag.
If you're only trying to find related articles based on elements (ie tags, categories, entries, etc), you can use my Similar plugin.

Here's a basic example, more info in the repo:

{% set similarEntriesByTags = craft.similar.find({ element: entry, context: entry.tags }) %}

&lt;ul&gt;
    {% for similarEntry in similarEntriesByTags %}
        &lt;li&gt;{{ similarEntry.title }} ({{ similarEntry.count }} tags in common)&lt;/li&gt;
    {% endfor %}
&lt;/ul&gt;