Word-level bigrams/trigrams in tsvector
Word-level bigrams/trigrams in tsvector
От:
Alan Li <alanwli@gmail.com>
Дата:
I'm wondering how I can store word-level bigrams/trigrams in a tsvector that I can query against. I was expecting the final query to match "the air" and return the one tuple to me.
For instance:
Thanks, Alanpostgres=# create table docs (a tsvector);CREATE TABLEpostgres=# insert into docs (a) values (strip('''the air'' smells ''sea water'''::tsvector));INSERT 0 1postgres=# select * from docs;a--------------------------------'sea water' 'smells' 'the air'(1 row)postgres=# select * from docs where a @@ to_tsquery('''the air''');a---(0 rows)