Closed MattSurabian closed 7 months ago
Right now, we're just using ILIKE '%git%'
in the SQL query, but additional logic could be added in the JavaScript to further filter out bad matches.
Here's a basic example:
const search = 'git';
const queryResults = ['Git', 'Digital', 'My Git Example', 'Gitosis'];
const re = new RegExp(`\\b${search}`, 'i');
const filteredResults = queryResults.filter(s => re.test(s));
filteredResults // ["Git", "My Git Example", "Gitosis"]
Fuzzy search is well and good but this is maybe too fuzzy