One method of implementing full-text search in PostgreSQL is by storing your searchable content in a tsvector column. You can add a GIN index on this column for super fast full-text search, but its not required.

The idea is that you have, for example, a title column that you want searchable. So you make a tsvector column and then store the search index for the title column in the tsvector column.

As content is added to the title column you need to make sure the search index is kept up-to-date. This is where a pgsql trigger comes in to play:

In this trigger we always update the tsvector on an INSERT and only update it on an UPDATE when the text actually changes.