Johann Spies <jspies@xxxxxxxxx> writes: > I am beginning to use the full text search facilities in Postgresql > (9.0) and find the result of this query a bit strange: > query: > SELECT ts_headline('simple',title, to_tsquery('kerkreg|(church & polity)')) > from akb_articles A > where A.tsv@@ 'kerkreg|(church & polity)' > Result > "Kerkvereniging en <b>Kerkreg</b>: Geskiedenis, beginsel en praktyk.(<b>Church</b> unity and <b>church</b> polity: History, principle and practice.)" > Why is 'polity' not highlighted? I believe the problem is that the one-argument form of to_tsquery() uses the default TS configuration, which you have probably not got set to "simple". For me, the default TS configuration is "english", which will stem "polity" as "politi": regression=# select to_tsquery('(polity & church)'); to_tsquery --------------------- 'politi' & 'church' (1 row) However the "simple" configuration doesn't do anything to that lexeme: regression=# select to_tsquery('simple', '(polity & church)'); to_tsquery --------------------- 'polity' & 'church' (1 row) So what you've got is ts_headline() parsing the given title against the "simple" configuration and getting "polity", but the tsquery is looking for "politi", hence no match. In short: omit the 'simple' argument from the ts_headline call, and things should play together better. You could alternatively insert to_tsquery('simple', '(polity & church)'), but that won't exactly match what the @@ in WHERE is doing: that's going to use the default configuration. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general