Word-by-word match

Hey there folks!

I need help with a little matching system that matches words individually.

Preferred system:
“How to make delicious lasagna” & “Homemade lasagna recipe” = match, both have lasagna.

At the moment, I’ve tried using split texts, but they didn’t really work. If the words aren’t in the exact same order, it won’t match.

Current system:
“How to find all Barn Finds” & “All Barn Finds in X Game” ≠ match, even though both have Barn Finds.

Is there a way to implement the preferred system in Glide?

Thanks,
— Dias

I think your problem has two sides to it:

  • Your “keyword” sometimes has 1 word (lasagna), some other times may have 2 words (Barn Finds). Do you have a list of these anywhere?
  • You also want to match Finds Barn with Barn Finds based on your “in the exact same order” part. Is it the case?

The keywords are based on user input, so we can’t make a set list of keywords, they always vary—now for the “Barn Finds” part the exact order doesn’t matter, I need it to match the words “Barn” and “Finds” no matter the position in the string (e.g. “Barn Finds”, “Barn & Finds” & “Finds Barn” should match)

But how do you single out the “Barn Finds” from the user input?

We don’t single out specific terms—we take a title (e.g. “How to find all Barn Finds in X game”), remove filler words (how, to, in, all, X game (already added as a parameter)) leaving us with a cut down version (find Barn Finds) and then what we’d like to do is to find other entries that use the same words somewhere in the title, like this:

User input: “find Barn Finds”
Entry 1: “discover Barn Finds
Entry 2: “Finds Barn unlockables”
Entry 3: “find cars”

If you know how Google autocomplete works, it’s similar to that.

In summary, we’d like to take the words from a cut down version of the user input and then match each one individually to other entries, no matter their position in the entry.

Do you already have logic in place to do the above?

I think I would use JavaScript. Pass two parameters:

  • a comma separated list of search terms
  • the string to be searched

If you’re not familiar with JavaScript, ChatGPT is your friend :slight_smile:

1 Like

I do! I’ll see what I can do with JavaScript.