M
M
Microp2019-12-18 09:50:47
PostgreSQL
Microp, 2019-12-18 09:50:47

How to use pg_trgm along with full text search?

Good afternoon, there is a need to use fuzzy search on relatively large strings using only Postgres.
Those. as I understand it, the pg_trgm extension allows you to find similar strings, but if their length is several times different, then the similarity search scheme will not work.
Example you need to find the string
White semi-sweet wine drink "Santo Stefano Matrimonio Siciliano"
According to the input data
Sento Sefano
Is it possible and how to implement this search.
1. In theory, you need to find to_tsvector from
2. Look for similar words from the resulting words using pg_trgm, str1 % str2
How to implement this functionality correctly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question