Hi All, I hoping someone can help me out.
I’m making a simple recipe app. It has a basic tag functionality. Recipes are tagged, e.g.: an Indian chicken curry might have the tags: Indian, Chicken, & Curry. Users can also select tags they are interested in. Then I’ll have a ‘feed’ list of recipes matching the user’s tags.
I’ve got this functionality working well. I have three collections: Users, Recipes, & Tags. And users and recipes each have a many to many relationship to tags. I then have a list of any recipes where tags match the user (Logged in User> Tags> Recipes)
But, here is the tricky bit. I’m hoping to sort the list based on the number of shared tags. So that recipes that match more of the user’s tags are shown higher in the list.
So for example if the user has the tags ‘chicken’ and ‘curry’ then the recipe for Indian chicken curry, which matches with two tags: Chicken and Curry, will display higher in the list than a recipe like Chicken Snitzel which only matches the ‘chicken’ tag.
I haven’t been able to figure this one out. Can anyone help? Is there a way to set up the sorting that might do this. Or maybe a number of separate lists each corresponding to a shared tag count? Is there a way of determining the number of shared tags?
Btw: Loving Adalo, and the friendly community