Re: Simplifying Text Search - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Simplifying Text Search
Date
Msg-id 1194882500.2644.178.camel@ebony.site
Whole thread Raw
In response to Re: Simplifying Text Search  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Simplifying Text Search  (David Fetter <david@fetter.org>)
List pgsql-hackers
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?

--  Simon Riggs 2ndQuadrant  http://www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Proposal: Select ... AS OF Savepoint
Next
From: David Fetter
Date:
Subject: Re: Simplifying Text Search