Search Postgresql Archives

Re: How to perform full text search

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/18/12 11:45 AM, Andrus wrote:
select
+case when productname ilike '%red%'  then 2 else 0 end
+case when productdescription ilike '%red%'  then 1 else 0 end
+case when productname ilike '%cat%'  then 1.7 else 0 end
+case when productdescription ilike '%cat%'  then 0.7 else 0 end
from products
order by 1 desc
limit 100

This allows to define relevance.
Is my solution reasonable ?

if you don't mind a full table sequential scan each time you execute that, I suppose.

--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux