Add synonyms custom dictionary to Amazon RDS for PostgreSQL
Asked Answered
M

1

8

I have a database of products which I do a full-text search on using pg_search Gem. The query looks something like this:

SELECT "products".* FROM "products" WHERE (((to_tsvector('english', coalesce("products"."description"::TEXT, ''))) @@(to_tsquery('english', ''' ' || 'purchase' || ' '''))));

As I am doing a Full-text search, I want to add the search functionality for following

  1. Synonyms search eg. words purchase, buy, acquire, obtain
  2. Near By words eg. words (table, chair) or (pen, Pencil, Eraser)
  3. Spelling mistake

Now, a notable problem with this search is, when somebody searches any of these, I need to search products for all of these terms(synonyms and near by word and spelling mistake).

But it seems we need to give the synonyms dictionary as input to have this kind of search functionality. How to add custom dictionary to PostgreSQL? Even if we manage to add synonyms dictionary to postgresql, How can we add this to my AWS RDS (Amazon RDS for PostgreSQL) database?

Refer link for synonyms: http://shisaa.jp/postset/postgresql-full-text-search-part-2.html

Muzzleloader answered 19/5, 2015 at 6:0 Comment(1)
Did you ever find out a solution for this??Maria
O
1

According to this thread, it's not possible at the moment (2020).

Unfortunately, because RDS doesn't provide filesystem access, you won't be able to upload your custom files to $SHAREDIR.

Outstretch answered 28/9, 2020 at 12:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.