Re: select exact term

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Marc Fromm <Marc(dot)Fromm(at)wwu(dot)edu>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: select exact term
Date: 2013-03-29 00:06:43
Message-ID: CAL_0b1vHCYCjL0HwidZe99FYWsmObi8R7TKLqmy881DGHo4DVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Mar 28, 2013 at 10:51 AM, Marc Fromm <Marc(dot)Fromm(at)wwu(dot)edu> wrote:
> Is there a way to create a select statement that will select a record if the
> exact term is found in a field that contains the text to describe something?

In addition to what has been suggested before you may find interesting
full text search abilities
http://www.postgresql.org/docs/9.2/static/textsearch.html. It allows
to do more complex searches like this:

SELECT title, ts_rank_cd(textsearch, query) AS rank
FROM apod, to_tsquery('neutrino|(dark & matter)') query
WHERE query @@ textsearch
ORDER BY rank DESC
LIMIT 10;

--
Kind regards,
Sergey Konoplev
Database and Software Consultant

Profile: http://www.linkedin.com/in/grayhemp
Phone: USA +1 (415) 867-9984, Russia +7 (901) 903-0499, +7 (988) 888-1979
Skype: gray-hemp
Jabber: gray(dot)ru(at)gmail(dot)com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Rural Hunter 2013-03-29 05:56:58 Grant tables cascade to sequence?
Previous Message Marc Fromm 2013-03-28 20:30:16 Re: select exact term