How to search for similar words or synonyms in PostgreSQL

2

I need to make a search return similar words to me

I found the phonetic search it can even be used to refine the search I need, but I do not think that is ideal.

For example, in a database I have several professionals, but your professional experience does not match any word patterns.

When doing the search: "Supermarket Manager", I would like to get results like:

  • "Supermarket Manager"
  • "Supermarket Management"
  • "Supermarket Director"

Would anyone have any suggestions?

Thank you

    
asked by anonymous 26.05.2015 / 00:54

1 answer

-1

Rafael,

I believe you will achieve this by using Full Text Search. link

select * 
from tabela 
where to_tsvector('portuguese', campo_text) @@ to_tsquery('portuguese', 'Gerente & Supermercado')

Depending on the amount of information to process, you can create a column in your tsvector table, so you only need to use to_tsquery() in where with query content.

I hope I have helped:)

    
14.05.2016 / 02:28