Dumb recommendation system by matching lists

Was trying to build a pretty simple dumb recommendation system by matching a Thing to other Thing’s through a list of “tags”. I’ve been at this for a few hours now and have hit a brick wall.

Scenario:

Thing “photo” with list field “tags”

Photo A has a list of “tags” - cat, dog, horse
Photo B has a list of “tags” - horse, monkey

When I’m displaying Photo A, I want to also display photo B as a “you might also like…”
because Photo B and Photo A both have a tag named “horse”

Doing something like a RG set to display “photo” and search for photo’s tags contains Photo A’s tags requires the full list to be the same. So I read somewhere on the forum that the function “contains list” is the way to go to cross compare two list for any match. However, using “contains list” simply shows me all entries in the database with a blatant disregard for what’s in the “tags” lists.

The ever so slightly useful documentation explains “contains list” as such,

… contains list …

Returns yes if the first list contains all the entries from the second list.

What I’m looking for is a function to search the second list for any of the entries in the first list, and spit out all the Things that have lists with one or more matching animal in it’s list.

Now, it would of course be even cooler if you could then weight this in the sorting by how many similar tags a thing has… but I’m getting greedy here.

Perhaps none of this is possible, perhaps it’s super easy and I’ve just been away from Bubble for too long to remember, or perhaps this is a case where I need @keith’s powerful listshifter, that I can never seem to wrap my head around. :crazy_face: < me trying to use listshifter