Hey guys, today I’m going to talk about fuse-operators, this library allows us to make search applying different conditions on a string search just like you would normally do on SQL Language. No back-end database is needed, just javascript objects.

Before all, lets see a demo

What is a fuzzy search?

A fuzzy search is a process that locates elements that are likely to be relevant to a search argument even when the argument does not exactly correspond to the desired information. A fuzzy matching program can operate like a spell checker and spelling-error corrector. For example, if a user tries to find “Misissippi” the program can do a match with Mississippi.

Installation

How to use

Given this data model.

And operator

Explanation: Only the first row will be returned because `old man` matches with title and scalzi match with author.lastName from the same row

Or operator

Explanation: Both rows matches because `old man` matches with the title from the first row and `artist` match with title from the second row

Subset operator

Explanation: Only the first rows match because `old man || the lock artist` matches both rows but to this result is applied the second search with scalzi and this only returns the first row.

Ldmarz

Written by

Ldmarz

Software Developer, Mostly Web Technologies @ Facebook: https://www.facebook.com/ldmarzBlog/ @ Twitter: @ldmarz

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade