| From: | Jeremaine Johnson <JJohnson(at)vocal(dot)co(dot)uk> |
|---|---|
| To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Fulltext Search Function |
| Date: | 2012-07-11 15:17:10 |
| Message-ID: | 38950AAC6DD74747BD96C13DCC6F486201257AF4B100@VOCAL-SBS.vocal.local |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hi,
I am new to Postgres and I've been able to get the full text search working, (at least running searches in PGAdmin) my problem is, I would like to pass in a search text from my online application as an input parameter into a function in Postgres that would do a search on my table and not sure how to achieve this.
Any help would be appreciated, query below:
SELECT name, description, ts_rank_cd(textsearchable_index_col, query, 32 /* rank/(rank+1) */) AS rank
FROM companies , to_tsquery('client | (uk & vocal)') query
WHERE query @@ textsearchable_index_col
ORDER BY rank DESC
LIMIT 10;
Thank you.
Jeremaine Johnson
DBA / Developer
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Josh Kupershmidt | 2012-07-11 15:27:58 | Re: Python + listen/notify |
| Previous Message | Gregorio, Albert | 2012-07-11 15:13:25 | Please Post |