Re: Tsearch2 lexeme position

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема Re: Tsearch2 lexeme position
Дата
Msg-id 3F3A526A.5080401@sigaev.ru
обсуждение исходный текст
Ответ на Tsearch2 lexeme position  (Alexander Rüegg <arueegg@uni-bielefeld.de>)
Ответы Re: Tsearch2 lexeme position
Список pgsql-general

Alexander Rüegg wrote:
> Hi,
>
> Is it possible to get all the positions of a lexeme in a result-set of a
> query? For example, we have the table
>
> TEXT                                                   TEXT_IDX
> 'TSearch2 is very cool'                                ...
>
> 'It would be much cooler with lexeme positions'
>
> Our query is
> SELECT text, position FROM thetable WHERE  text_idx @@ 'cool'::tsquery;
>                          ^^^^^^^^
> The result should be something like:
> 'TSearch2 is very cool', 4
> 'It would be much cooler with lexeme positions', 5
>
> If not, is there a function that returns the positions of a lexeme in a
> single entry?
>

You can write such function, but why do you need it? May be there is more simple
way to resolve your problem?

BTW, lexeme can have more that one position...



--
Teodor Sigaev                                  E-mail: teodor@sigaev.ru


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PostGreSQL - Accessing It
Следующее
От: Dennis Gearon
Дата:
Сообщение: Re: How to prevent vacuum and reindex from deadlocking.