3 ms·
> Only Typesense and MeiliSearch properly handled mis-spellings (the "suprman" query). That's where trigrams come in. pg_trgm can fix mis-spellings, and even c
by theandrewbailey 4y ago
> Only Typesense and MeiliSearch properly handled mis-spellings (the "suprman" query).
That's where trigrams come in. pg_trgm can fix mis-spellings, and even compound words ("super man" to "superman"). I opt for performing the search as entered, and use trigrams to offer suggestions to the user, e.g. do the search for "suprman", but show an option to search for "superman".
- hardwaresofton 4y agoAbsolutely -- this is something I didn't include in the article -- it wasn't really fast-search/type-ahead search per say. Gitlab actually has a great article about this for those who want to read more: https://about.staging.gitlab.com/blog/2016/03/18/fast-search-using-postgresql-trigram-indexes/ https://about.staging.gitlab.com/blog/2016/03/18/fast-search...
- ro0ster 4y agoI think it would be useful to include pg_trgm's performance vs others as well. I'm not sure how it compares but in my use case with 200,000 rows it has been "good enough" for <100ms autocomplete.