What we usually do is index documents and get them back by querying. What the percolator allows to do in a nutshell is index queries and percolate documents against the indexed queries to know which queries they match. It's also called reversed search.
Is it possible to percolate in PostgreSQL?
tsquery
andJOIN on to_tsvector(document) @@ query
. – Erratic