Re: Identifying which column matches a full text search

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Identifying which column matches a full text search
Дата
Msg-id 488F8BCE.5090701@archonet.com
обсуждение исходный текст
Ответ на Identifying which column matches a full text search  (Ryan Wallace <rywall@interchange.ubc.ca>)
Ответы Re: Identifying which column matches a full text search  (Ryan Wallace <rywall@interchange.ubc.ca>)
Список pgsql-sql
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 match was found in?

Afraid not - you're not indexing two columns, you're indexing one: 
textsearchable_index_col.

You can add up to four weights to a tsvector though, typically for 
title/body matching. See chapter 12.3 for details.

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.

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: "Igor Neyman"
Дата:
Сообщение: Re: column names with - and (
Следующее
От: Emi Lu
Дата:
Сообщение: Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date