Full text search doesn't find anything when query has accents

427 Views Asked by At

I have these words: "Fábrica, mágico" that full text search is not returning although the rest is working properly.
My code is (using Elixir lang):

def search(query, search_term) do
    (from u in query,
    where: fragment("(to_tsvector('portuguese', ?) || to_tsvector(coalesce('portuguese', ?))) @@ plainto_tsquery('portuguese', ?)", 
                    u.name, u.desc, ^search_term),
    order_by: fragment("ts_rank((to_tsvector('portuguese', ?) || to_tsvector(coalesce('portuguese', ?))), plainto_tsquery('portuguese', ?)) DESC",
                    u.name, u.desc, ^search_term))
  end

How to solve this?

0

There are 0 best solutions below