Finding intercept of two documents (two tsvector fields)

Поиск
Список
Период
Сортировка
От Allan Kamau
Тема Finding intercept of two documents (two tsvector fields)
Дата
Msg-id AANLkTinNgadhJByS6ivOB-xmSaqWL=Mc846MRpMd9xMt@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
I am looking for a way to obtain the words that are common amongst two
tsvector records.

The long workaround I know is to:
1)convert the contents of the tsvector fields to text then find and
replace single quote followed by space then single quote with a comma
character then stripping away the first and last single quote
characters.
2)convert this CSV data into array using string to array.
3)Perform a join on these two arrays and unnest them and join on the
unnested values.
4)Perform array_agg on any one field (of unnested array values) of
these two tables with aid of a GROUP BY.
5)cast the array to string using a white space as the delimiter.
6)cast the string to tsvector.

Allan.

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

Предыдущее
От: Henk van Lingen
Дата:
Сообщение: Forcing the right queryplan
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: pg_dump --compress error