Word-level bigrams/trigrams in tsvector - Mailing list pgsql-hackers

From Alan Li
Subject Word-level bigrams/trigrams in tsvector
Date
Msg-id CAHw2fqgVthKZ7OfTwqNOn1huJpVbgjHB=y5L-RD+cbk+qykivg@mail.gmail.com
Whole thread
List pgsql-hackers
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:

postgres=# create table docs (a tsvector);
CREATE TABLE
postgres=# insert into docs (a) values (strip('''the air'' smells ''sea water'''::tsvector));
INSERT 0 1
postgres=# select * from docs;
               a                
--------------------------------
 'sea water' 'smells' 'the air'
(1 row)

postgres=# select * from docs where a @@ to_tsquery('''the air''');
 a 
---
(0 rows)

Thanks, Alan

pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: confusing message about archive failures
Next
From: Andres Freund
Date:
Subject: Re: Enabling Checksums