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 ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster