tokenize string for tsearch? - Mailing list pgsql-general

From Ottavio Campana
Subject tokenize string for tsearch?
Date
Msg-id 463FC4C6.10608@campana.vi.it
Whole thread Raw
Responses Re: tokenize string for tsearch?
Re: tokenize string for tsearch?
List pgsql-general
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

pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Date Math
Next
From: Ottavio Campana
Date:
Subject: change the stop words file for tsearch2