Skip to content

fuzzy search: trigram distance with postgres TG-592

Bengfort requested to merge 592-fuzzy-postgres-trigrams into master

This is very similar to !246 (closed), but uses trigram matching instead of levenshtein distance. The benefit is that substrings can also be matched.

I also tried a slightly different approach about filtering. Instead of selecting a fixed distance that is applied to both first and last name, I multiplied both similarities. The result is than used in two ways:

  • Only the ten best matches are shown
  • There is a minimum similarity of 0.04 (magic value)
Edited by Bengfort

Merge request reports