Hallo.
Ich habe eine Datenbank mit Blog Postings(posts). Zu jedem Posting gibt es n Kommentare(comments).
ALTER TABLE posts ADD COLUMN textsearchable_index_col tsvector;
UPDATE posts SET textsearchable_index_col =
to_tsvector('english', coalesce(title,'') || coalesce(content,''));
Zusätzlich zum Titel und dem Content des Posts möchte ich noch den Content der Kommentare zu diesem index hinzufügen.
Mein versuch schlägt leider fehl:
UPDATE posts SET textsearchable_index_col =
(SELECT to_tsvector(p.title) || to_tsvector(p.content) || to_tsvector(c.content)
FROM posts p JOIN comments c ON c.post_id = p.id
);
ERROR: more than one row returned by a subquery used as an expression
Kann mir jemand von euch bitte weiterhelfen.
danke!
franz