Postgres full-text search with synonyms
问题 I have a database of restaurants which I do a full-text search on. The code looks something like this: SELECT * FROM restaurant WHERE restaurant.search_vector @@ plainto_tsquery(:terms); And search_vector is defined like this: alter table restaurant add column search_vector tsvector; create index restaurant_search_index on restaurant using gin(search_vector); create trigger restaurant_search_update before update or insert on restaurant for each row execute procedure tsvector_update_trigger(