Related content list based on highest number of common tags

I’m trying to create a partial that will show a list of the “best” related posts at the end of each blog post. With “best” I mean the 3 (could be any number) of other posts that have the most tags in common with the post on the current page. I’ve been able to find several examples of related content that search for 1 or maybe 2 tags in common, but not one that sorts the results by the most tags in common and picks the top 3. (if the top X all have the same number of tags in common, then perhaps by date could sort them further if needed)

Does anybody know if this even possible to do? (and if yes, do you know how?)

Not sure you will get exactly what you want, but I recommend reading:

That was actually the first thing I tried. But I’m not quite sure what it bases the “related content” on. It seems to always return the X (say 5) posts that were published before the current one, sometimes in a slightly different chronological order (although I have found an exception or two sometimes when it didn’t show the previous 5 posts, but 1 came from a bit longer ago, say the number 8 ago). At least it’s not completely based on the tag similarity

I think it helps if you read the entire page I posted.

Apologies! I truly thought I had read and interpreted the entire page last night, but I appear to be very wrong indeed. The configurations provided exactly what I needed. Thank you! :slight_smile: