postgres に ts_vector 列を持つ検索テーブルがあります。この列に dstring を挿入するとベクトル化されるように見えますが、ステミングやストップ ワードの削除は行われません。
test=# create table sample_ts_vec ( id varchar(255), tsv tsvector);
CREATE TABLE
test=# insert into sample_ts_vec values ('t1234', 'this is a test');
INSERT 0 1
test=# select * from sample_ts_vec;
id | tsv
-------+------------------------
t1234 | 'a' 'is' 'test' 'this'
(1 row)
test=# insert into sample_ts_vec values ('t1235', to_tsvector('this is a test'));
INSERT 0 1
test=# select * from sample_ts_vec;
id | tsv
-------+------------------------
t1234 | 'a' 'is' 'test' 'this'
t1235 | 'test':4
(2 rows)
2 番目の挿入では、3 つのストップ ワードが削除され、単語がステミングされていることがわかります (この場合、ステミングは必要ありません)。一方、最初の例では、各単語が追加されます。挿入する前に to_tsvector 関数を文字列値に自動的に適用するにはどうすればよいですか?