Re: Simplifying Text Search - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Simplifying Text Search
Date
Msg-id 20071112152809.GC13476@svana.org
Whole thread Raw
In response to Simplifying Text Search  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Simplifying Text Search  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
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?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

pgsql-hackers by date:

Previous
From: Decibel!
Date:
Subject: Re: plpgsql keywords are hidden reserved words
Next
From: Gregory Stark
Date:
Subject: Re: Proposal: Select ... AS OF Savepoint