I have a table with a text field and a tsvector
containing the search index for that field:
CREATE TABLE test (pk bigint, value text, tsv tsvector);
How do I create a single tsvector
that is the combination of the vectors for all rows satisfying some condition?
SELECT value FROM test
WHERE combine_my_vectors(SELECT tsv FROM test WHERE pk IN (some list))
@@ to_tsquery('search me');
I know that tsvector
s can be combined with ||
, but that doesn't seem to be possible here. What do I use for combine_my_vectors
?
I would prefer to avoid having to combine my value
text fields first, and then create a tsvector
out of them.