Re: ts_headline

From: Stephen Davies <scldad(at)sdc(dot)com(dot)au>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ts_headline
Date: 2008-02-21 11:34:55
Message-ID: 200802212204.55219.scldad@sdc.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

I just spotted the difference between your test and mine.

My query says:

select ts_headline(abstract,to_tsquery('english','database'),'minWords = 99,
maxWords = 999') from document where id=21;

where your equivalent does not include the 'english' arg.

If I take out the 'english' from this query, I get the same result as you.

However, the following returns zero rows:

select title,author,ts_headline(abstract,to_tsquery('database') from document
where clob @@ to_tsquery('database')

It gets more interesting:

select title,author,ts_headline(abstract,to_tsquery('database') from document
where clob @@ to_tsquery('english','database')

returns the "correct" result - one row with the expected headline.

select title,author,ts_headline(abstract,to_tsquery('english','thesaurus')
from document where clob @@ to_tsquery('english','thesaurus')

also returns the "correct" result.

I suggest that the above indicates a bug somewhere.

Cheers and thanks,
Stephen Davies

On Thursday 21 February 2008 20:50, Richard Huxton wrote:
> Stephen Davies wrote:
> > Attached is the "document" in question.
> >
> > Searches for "norwegian", "thesaurus" and "statement" give good results.
> > A search for "database" gives the plain text from the beginning.
>
> Seems OK here - might need to look at your configuration settings.
> http://www.postgresql.org/docs/8.3/static/textsearch-debugging.html
>
> I'll make sure I've got a clean setup here and re-run the test.
>
>
> SELECT ts_headline(t, to_tsquery('database')) FROM tsearch_test;
> ts_headline
> ---------------------------------------------------------------------------
>---------------------------- <b>database</b> (using a 2 KB page) to a Large
> File Support (LFS) <b>database</b> (using an 8 KB page
> (1 row)

--
========================================================================
This email is for the person(s) identified above, and is confidential to
the sender and the person(s). No one else is authorised to use or
disseminate this email or its contents.

Stephen Davies Consulting Voice: 08-8177 1595
Adelaide, South Australia. Fax: 08-8177 0133
Computing & Network solutions. Mobile:0403 0405 83

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2008-02-21 12:00:25 Re: ts_headline
Previous Message Richard Huxton 2008-02-21 11:28:45 Re: ts_headline

Browse pgsql-patches by date

  From Date Subject
Next Message manolo.espa 2008-02-21 11:44:03 Re: 2WRS [WIP]
Previous Message Richard Huxton 2008-02-21 11:28:45 Re: ts_headline