I’ve written some tips on this before: https://austingwalters.com/fast-full-text-search-in-postgres...
Basically, it’s easy to create triggers that’ll update an index for you on entry. Then you can create custom indices that have key words, etc.
Basically, it’s easy to create triggers that’ll update an index for you on entry. Then you can create custom indices that have key words, etc.
In my experience using PG FTS, there are often some preprocessing tasks you might like to do before storing the index. One common thing is the generated index has to fit inside the column length limit. So if your user provides a long text field with a lot of unique words, then the index will be very long and might lead to a database error. So here you can check for that on the fly, and truncate the result.