Re: Simplifying Text Search

From: David Fetter <david(at)fetter(dot)org>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Simplifying Text Search
Date: 2007-11-12 15:51:09
Message-ID: 20071112155108.GG12490@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 12, 2007 at 03:48:20PM +0000, Simon Riggs wrote:
> On Mon, 2007-11-12 at 16:28 +0100, Martijn van Oosterhout wrote:
> > On Mon, Nov 12, 2007 at 03:00:36PM +0000, Simon Riggs wrote:
> > > Something Tom Dunstan just mentioned has made me ask the question "Why
> > > does our full text search feature look so strange?". It's the
> > > operator-laden syntax that causes the problem.
> > >
> > > By any stretch, this query is difficult for most people to understand:
> > >
> > > SELECT * FROM text_table
> > > WHERE to_tsvector('fat cats ate fat rats') @@ to_tsquery('fat & rat');
> > >
> > > Wouldn't it be much simpler to just have a function, so we can write
> > > this query like this?
> > >
> > > SELECT * FROM text_table
> > > WHERE text_search('haystack needle haystack', 'needle');
> >
> > Can't you do this with an SQL function that gets expanded inline?
>
> Yep, we can. Good thinking. So the change is fairly trivial.
>
> What do you think of the proposal to make text search work this way
> and to document this more easily readable form?

+1 for adding this.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Decibel! 2007-11-12 15:54:16 Re: minimal update
Previous Message Simon Riggs 2007-11-12 15:48:20 Re: Simplifying Text Search