You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Complex full-text search cannot be done directly on some cases. For example when using computed fields or if we want to do the FTS to multiple fields at the same time.
Our suggestion in the docs is not correct right now, since it won't use the index created there (#3845 won't fix this since it doesn't include computed fields).
Another approach is to create a separate tsvector column to hold the output of to_tsvector. To keep this column automatically up to date with its source data, use a stored generated column. This example is a concatenation of title and body, using coalesce to ensure that one field will still be indexed when the other is NULL
So we should suggest using this alternative in the docs.
The text was updated successfully, but these errors were encountered:
steve-chavez
changed the title
Suggest using generated columns fot Full-Text Search operations
Suggest using generated columns for Full-Text Search operations
Jan 23, 2025
Problem
Complex full-text search cannot be done directly on some cases. For example when using computed fields or if we want to do the FTS to multiple fields at the same time.
Our suggestion in the docs is not correct right now, since it won't use the index created there (#3845 won't fix this since it doesn't include computed fields).
Solution
According to the PostgreSQL docs, there is an option to use generated columns to achieve this:
So we should suggest using this alternative in the docs.
The text was updated successfully, but these errors were encountered: