fzy
pg_fzy · FZY algorithm for PostgreSQL
Overview
PostgreSQL · 11, 12, 13
Usage
Sources:
fzy exposes the fzy fuzzy-matching score to SQL. Use it to rank a modest set of candidate strings against an abbreviated or partially typed query; it is a scoring function, not an index or a complete search engine.
Core Workflow
Install the extension in the database, then calculate a score for each candidate and sort the result. The second argument must be converted to PostgreSQL’s C-string pseudo-type.
Higher scores are better matches. Version 0.0.1 implements only the case-insensitive form of the fzy algorithm.
SQL Object
fzy(cstring, cstring) RETURNS integercomputes the match score.
The function is declared strict, so a null argument produces null. It is also declared volatile by the extension SQL, which may limit planner optimizations. Because no index operator or access method is provided, PostgreSQL evaluates the function for every candidate row selected by the query.