PostgreSQL - full text search
Now I'm learning about full text search in PostgreSQL 9.2.3. However, I
have a problem. I run this example:
CREATE TABLE messages (title text,body text,tsv tsvector);
CREATE TRIGGER tsvectorupdate
BEFORE INSERT OR UPDATE ON messages FOR EACH ROW EXECUTE PROCEDURE
tsvector_update_trigger(tsv, 'pg_catalog.english', title, body);
INSERT INTO messages VALUES('title here', 'the body text is here');
Unfortunately, after:
SELECT title, body FROM messages WHERE tsv @@ to_tsquery('title & body')
I get no result - 0 rows returned. Could you tell me why? According to the
documentation of PostgreSQL it should work.
only 'titl' and 'bodi' as a query get aprropriate result. Why?
No comments:
Post a Comment