Search Postgresql Archives

Re: tokenize string for tsearch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 07, 2007 at 05:31:02PM -0700, Ottavio Campana wrote:
> Hi, I'm trying to use tsearch2 for the first time and I'm having a
> problem setting up a query
> 
> If I execute
> 
> SELECT * from test_table where ts_desc @@ to_tsquery ('hello&world');
> 
> it works, but I'm having the problem that the string used for the query
> is not 'hello&world' but 'hello world', Moreover, it can have an
> arbitrary number of spaces between the words, so I cannot just
> substitute the spaces with &, because 'hello&&world' gives error.
> 
> What is the safest way transform a string into a list of works "anded"
> together?

Look at plainto_tsquery().

//Magnus



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux