I want some technique to solve my problem. I am using Postgresql 10. I want to create a query that select substrings even if there's a difference of two letters. My language, portuguese, has many letters with same sound and people really make mistakes when typing. Roughly what I want to do is this.
if I have a product name with the name "automóvel grande"
atomóvel grande" would match //one letter is missing
automovel grnde" would match //lack accent and letter is missing
automovell grnde would match // lack of accent and the "l" was repeated
I used pg_trgm sometime ago and in my memory it worked, but, now, that I am using it again I am really getting some weird results.
I am using a setting like this:
ALTER DATABASE mydb SET pg_trgm.word_similarity_threshold = 0.2;
It is not able to match "capacete" when typing "capoceti".
I think the two words are similar enough. Chaning the threshold doesn't affect the result.