Re: [SQL] Identifying which column matches a full text search

2008-07-30 Thread Richard Huxton
Ryan Wallace wrote: Richard Huxton wrote: Failing that, where I've had many (a dozen) different sources but want to search them all I've built a textsearch_blocks table with columns to identify the source and have triggers that keep it up to date. Once you've built the text search blocks tabl

Re: [SQL] Identifying which column matches a full text search

2008-07-30 Thread Ryan Wallace
Richard Huxton wrote: > > Failing that, where I've had many (a dozen) different sources but want > to search them all I've built a textsearch_blocks table with columns to > identify the source and have triggers that keep it up to date. Once you've built the text search blocks table, how do you s

Re: [SQL] Identifying which column matches a full text search

2008-07-29 Thread Richard Huxton
Ryan Wallace wrote: UPDATE pgweb SET textsearchable_index_col = to_tsvector('english', coalesce(title,'') || coalesce(body,'')); WHERE textsearchable_index_col @@ to_tsquery('create & table') Using this approach. Is there any way of retrieving which of the original two columns the mat

[SQL] Identifying which column matches a full text search

2008-07-29 Thread Ryan Wallace
Hi all, The following example is given in the Postgres 8.3 manual regarding how to create a single ts_vector column for two existing columns: ALTER TABLE pgweb ADD COLUMN textsearchable_index_col tsvector; UPDATE pgweb SET textsearchable_index_col = to_tsvector('english', coalesce(ti