to_tsvector('english', 'running shoes') gives 'run':1 'shoe':2. You match it against a tsquery with the @@ operator, and index it with a GIN index.