Re: OR tsquery

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема Re: OR tsquery
Дата
Msg-id 20100116215703.6d2b79a9@dawn.webthatworks.it
обсуждение исходный текст
Ответ на Re: OR tsquery  (Oleg Bartunov <oleg@sai.msu.su>)
Ответы ranking how "similar" are tsvectors was: OR tsquery
Список pgsql-general
On Sat, 16 Jan 2010 19:10:45 +0300 (MSK)
Oleg Bartunov <oleg@sai.msu.su> wrote:

> Ivan,

> did you ever read official documentation ?
> http://www.postgresql.org/docs/8.4/static/textsearch-controls.html

Yes but I still can't find something that works like plainto_tsquery
but with | or any example that wouldn't make obtaining that result
convoluted.

plainto_tsquery do a couple of stuff that I find hard to replicate
with the available functions.
It split a string into lexemes.
It loops over the lexemes to build up the query with &.

Something like:

select (
  string_to_array(
    strip(
    to_tsvector('pg_catalog.english',
      'orange banana woods booking'))::text
   , ' ')
   )[i]
  from generate_series(0,3) s(i);

and then gluing up the pieces with |.

And the above example still miss to solve some of the details like
cleaning the '.

Another option would be to return the tsvector to the client and
then build the tsquery there and send it back to the server.

I'm on 8.3 but I don't think it makes any real difference for this.

Sorry if I'm still missing the obvious.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


В списке pgsql-general по дате отправления:

Предыдущее
От: Mathieu De Zutter
Дата:
Сообщение: Re: Constraint exclusion issue
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Collate order on Mac OS X, text with diacritics in UTF-8