Full text search in milliseconds with PostgreSQL
<i>To get optimum performance with PostgreSQL full text search you need to create a column to store the tsvector values with an index on it. Then you need to fill this column with the tsv values and create a trigger to update the field on INSERT and UPDATE.</i><p>I've been playing around with full text search in Postgres, and I took this sort of approach when starting out, but then realized you I could just have the index be an expression.<p>So instead of (per the example)<p><pre><code>  CREATE INDEX tsv_idx ON documents USING gin(tsv);
</code></pre>
doing something like<p><pre><code>  CREATE INDEX tsv_idx ON documents USING gin(to_tsvector('english', text));
</code></pre>
Is there any reason you <i>wouldn't</i> do this? For multi-languange you you'd have to detect the language of the text, but there's no reason you couldn't parameterize that too.