Is it possible to implement full text search using postgresql when queries can be with misprints? I couldn't find it in manual.
Asked
Active
Viewed 2,173 times
5
-
Are you looking for typo / transcription-error resistant full-text search? If so, no, FTS doesn't currently support fuzzy or "similar" searching. – Craig Ringer Jan 13 '14 at 01:09
-
auto-correct your queries before using them. use a spell-checker. – Neil McGuigan Jul 29 '14 at 19:09
1 Answers
2
I'm not totally sure what you mean by misprint.
If you are looking for fuzzy string matching, the fuzzystrmatch
extension is what you want.
fuzzystrmatch
is a module, you must "install" it by running :
CREATE EXTENSION fuzzystrmatch;
This way of installing extensions exists since PostgreSQL 9.1.
For previous versions, you needed to run the sql script in the contrib dir for that extension against your database.

Craig Ringer
- 307,061
- 76
- 688
- 778

Raphaël Braud
- 1,489
- 10
- 14
-
2Ah, knew I'd seen a blog about it somewhere. There's a similar example here using trigrams: http://tapoueh.org/blog/2013/09/06-pg_trgm-suggestions – Richard Huxton Jan 13 '14 at 09:33