Re: tokenize string for tsearch?
| От | Magnus Hagander |
|---|---|
| Тема | Re: tokenize string for tsearch? |
| Дата | |
| Msg-id | 20070508071852.GA25542@svr2.hagander.net обсуждение исходный текст |
| Ответ на | tokenize string for tsearch? (Ottavio Campana <ottavio@campana.vi.it>) |
| Ответы |
Re: tokenize string for tsearch?
|
| Список | pgsql-general |
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
В списке pgsql-general по дате отправления: