From: Oleg Bartunov <oleg@sai.msu.su>
To: chester c young <chestercyoung@yahoo.com>
Cc: Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: simple web search
Date: Fri, 23 Feb 2007 21:30:40 +0300 (MSK)
Message-ID: <Pine.LNX.4.64.0702232129510.400@sn.sai.msu.ru> (raw)
In-Reply-To: <784381.72635.qm@web54306.mail.yahoo.com>
References: <784381.72635.qm@web54306.mail.yahoo.com>
I think contrib/tsearch2
http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/
is what you need.
Oleg
On Fri, 23 Feb 2007, chester c young wrote:
>> I'm considering implementing a search box on my review web site
>> http://lesculturelles.net and am looking for a simple way to match
>> entered words against several columns on related tables:
>> show.show_name, story.title, person.firtname, person.lastname, etc.
>
> one solution would be a view:
>
> create view search_v as select
> 'show'::name as tab_nm,
> show_id as tab_pk,
> 'Show Name' as description,
> show_name as search
> from show
> union select
> 'story'::name,
> story_id,
> 'Story Title',
> title
> from story
> union ...
>
> your query would be
> select * from search_v where '$string' ilike search
>
> this would return a list the user could use to drill down further.
>
> many ways to skin this cat.
>
>
>
>
> ____________________________________________________________________________________
> It's here! Your new message!
> Get new email alerts with the free Yahoo! Toolbar.
> http://tools.search.yahoo.com/toolbar/features/mail/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
> http://www.postgresql.org/about/donate
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: oleg@sai.msu.su, chestercyoung@yahoo.com, vindex+lists-pgsql-sql@apartia.org
Subject: Re: simple web search
In-Reply-To: <Pine.LNX.4.64.0702232129510.400@sn.sai.msu.ru>
References: <784381.72635.qm@web54306.mail.yahoo.com> <Pine.LNX.4.64.0702232129510.400@sn.sai.msu.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox