KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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('search_vector', 'pg_catalog.english','title'); Now, a notable problem with this search is the word barbecue. It can be spelled many different ways: barbecue, barbeque, BBQ, B.B.Q., B-B-Q, etc. When somebody searches any of these, I need to search restaurants for all of these terms. From what I've read online, it seems I need to modify the dictionary (That would be pg_catalog.english , right?), but I'm not sure how to go about this.
Tags (comma-separated)
Save Edits
Cancel