Ranking items based on common sub-items/attributes

Hi everyone!

So, I’ve created an app/database that catalogs and compares information about professional lighting fixtures.
Each fixture has a list of various features/attributes that are associated with it.
For example:
Fixture A has features [Iris, AnimationWheel, GoboWheel, Strobe]
Fixture B has features [Iris, FramingShutters, GoboWheel, Frost, ColorMixing, ColorWheel]
Fixture C has features [FramingShutters, GoboWheel, Strobe, ColorWheel]
and so and so on for as many as 1000 fixtures or so.

What I need help with is figuring out the process of ranking/comparing all of these fixtures based on their features. So two fixtures with the exact same set of features would be a perfect match, whereas two fixtures with none of the same features would be not at a match at all. And then a ranking of similar fixtures in between.

The idea is that viewing a page of any single fixture will provide a list of “similar fixtures” ranked by how similar this page’s features are to other fixtures’ features.

The features are known, in that I have a table of “features” that each “fixture” references.

I keep thinking/hoping that the “rank by” function would be helpful in this, but I just can’t quite figure out how. I know I need to involve more numbers somewhere in all of this…

I have no doubt there is a solution to this, and while I have a fairly strong understanding of databases and basic expressions, this sort of data science is just a little beyond me. Any help you can provide would be amazing! Thanks!

@brianabbottlight Might be helpful going through similar data organization posts (1,2) on the forum. The main idea is create a custom data type for the broadest category, fields for attributes and then compare using data operations and comparisons.

thanks @neerja! that did help my thinking a little… however, i’m still running into a wall

Here’s a screenshot of a little demo page i put together

So far, I’m able to display similar fixtures using “intersect with”. Which is a great first step.

But what I still want is to SORT that list by the number of “intersecting” features. And it’s not obvious if bubble is able to do that in any easy way…

For clarification, there’s only two tables being used here:

The Fixture table has a field called “search_allfeatures” which is a list of “Features”

Any thoughts?

1 Like

After lots of searching the interwebs, I think what I’m trying to do is implement is a “Jaccard similarity index”

I’m just not entirely sure how to (or if i even can) implement this theory in bubble. And whether or not it is something that can be run client-side, or if there needs to be a server-side script or API or something that handles this.

1 Like

I am in the same situation, comparing products through their list of tags, to find similar product. I am stuck. does it work for you when increasing the advance filter count to 1??? For me is not working, and I believe it is a bug.

The workaround I have been thinking, is to create a condicional structure base on the number of results, but the advance filter is giving me a hard time, and the count has to be increased