Search Postgresql Archives

tokenize string for tsearch?

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

 



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?

Thank you

-- 
Non c'e' piu' forza nella normalita', c'e' solo monotonia.

Attachment: signature.asc
Description: OpenPGP digital signature


[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