Re: ts_headline

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: ts_headline
Дата
Msg-id 47BD467D.7010407@archonet.com
обсуждение исходный текст
Ответ на Re: ts_headline  (Stephen Davies <scldad@sdc.com.au>)
Ответы Re: ts_headline
Список pgsql-general
Stephen Davies wrote:
> G'day Richard.
>
> I don't think so. A sample command is:
>
> ts_headline(abstract,to_tsquery('english','database'),'minWords = 99, maxWords
> = 999')
>
> I have also tried with smaller maxwords without any visible effect.

Hmm - a simple test seems to work OK.

SELECT ts_headline( repeat('apple banana carrot ', 100),
to_tsquery('apple'));
                                                               ts_headline

----------------------------------------------------------------------------------------------------------------------------------------
  <b>apple</b> banana carrot <b>apple</b> banana carrot <b>apple</b>
banana carrot <b>apple</b> banana carrot <b>apple</b> banana carrot
(1 row)

It's not just the start of the text either:

SELECT ts_headline( repeat('elephant ', 100) || repeat('apple banana
carrot ', 100), to_tsquery('apple'));
                                                               ts_headline

----------------------------------------------------------------------------------------------------------------------------------------
  <b>apple</b> banana carrot <b>apple</b> banana carrot <b>apple</b>
banana carrot <b>apple</b> banana carrot <b>apple</b> banana carrot
(1 row)

Can you provide a piece of text that shows the problem?

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Stephen Davies
Дата:
Сообщение: Re: ts_headline
Следующее
От: Stephen Davies
Дата:
Сообщение: Re: ts_headline