Обсуждение: [Postgresql NLS support] : Help on using NLS , Custom dictionary to enhance our website search functionality
[Postgresql NLS support] : Help on using NLS , Custom dictionary to enhance our website search functionality
От
Nivedita Kulkarni
Дата:
Hi All,
We have newbie to Postgresql.
Background:
We have site hosted on Ruby on Rails using Postgresql database.It is a eCommerce site and for which we need to provide the NLS supported Search functionality to help end users while searching by using Synonyms, related word , Plurals and Singular , Stop words etc.
Problem
As per our analysis we found that with Postgresql NLS it possible to do following with any custom changes:
1. Participles (help,helps,helped,helping)2. Multi-word (search results)3. Single word (results)4. Plurals and Singular (s,es)5. Punctuation's (.,;,!,:,')6. Stop words (And, or, as , an, but)
Reading the documentation for Custom dictionary, We tried to use the Custom dictionary postgresql/9.3/tsearch_data and added following to test :
buy purchasebig enormousmammoth elephantindices index*
But we found that when we search for word "Purchase" we get search result for"Purchase" and "Buy" both.
But when we search for "Buy" then we don't get search result for "Purchase".
We are using following query to using which we found that transitive synonym search is not working for us.
SELECT "products".* FROM "products" WHERE (((to_tsvector('english', coalesce("products"."description"::TEXT, ''))) @@(to_tsquery('english', ''' ' || 'purchase' || ' '''))));
I think transitive support will be basic function and Postgresql database must have provided. Please let us know if some setting or configuration changes are needed to enable this feature.
Also as per our finding, following are points on which it seems there is no direct way in Postgresql:1. Related words (Pushchair buggies)2. Near by words (Pen , Pencil, Eraser)3. Synonyms (buy<=>purchase,big<=>enormous)4. Spelling Mistake
We look forward for feedback / suggestions our problem or suggest any alternative solution, how this can be done ?
Thanks in advance
Thanks and regards,
Nivedita Kulkarni
Nivedita Kulkarni
On Tue, May 26, 2015 at 2:46 AM, Nivedita Kulkarni <nkulkarni@genius-minds.com> wrote: > We have newbie to Postgresql. Hi, You've reached the pgsql-hackers mailing list, which is for discussion of current development issues, problems and bugs, and proposed new features. Questions about how to use PostgreSQL should be directed to one of the user mailing lists, such as pgsql-general or pgsql-novice. Please repost your question to one of those lists. Thanks, -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company