Recommended Recommendation: Rails, Postgres, and Fuzzy Full-Text Search

I have a Rails application with a Postgres backend.

I need to add a full-text search that will allow fuzzy searches based on Levenshtein distance or other similar metrics. Add the fact that lexer / stemmer should work with non-English words (it would be nice to just turn off language-dependent functions when lexing, so as not to be confused with the target language, which may have significant words that are considered irrelevant by the English engine).

I think tsearch Postgres will not be applied here because it does not have a fuzzy search - please correct me if I am wrong.

What are the possible combinations of backends and plugins? He would prefer solutions that add less infrastructure (for example, if Postgres might have fuzzy fts, why use external Lucene); OTOH, the inclusion of Rails plugins is important.

What would you recommend?

update : it looks like I need metrics based on n-grams rather than Levenshtein.

+3
source share
3 answers

Rails + Postgres + Solr + Sunspot

Solr Lucene, Lucene. Sunspot - Ruby Solr API. Sunspot, Solr Rails PostgreSQL, .

+6

PostgreSQL pg_trgm ( contrib/). , (, ), .

+3

texticle - Postgres.

0

Source: https://habr.com/ru/post/1725431/


All Articles