ffxsam
ffxsam

Reputation: 27713

Postgres full text search (tsvector / tsquery) not behaving as expected

This article has the following example:

SELECT to_tsvector('english', 'The quick brown fox jumped over the lazy dog')  
  @@ to_tsquery('jumping');

(note: I had to add 'english' for it to work properly at all)

They claim this returns a true value. However, I get false. Even if I query for 'jumped', it returns false!

Another test I ran that should've returned a true value:

SELECT to_tsvector('english', 'Markets Officer bandwidth') @@ to_tsquery('officer');

This returned false.

Why is this happening?

Upvotes: 2

Views: 1188

Answers (1)

ffxsam
ffxsam

Reputation: 27713

Aha! This works:

SELECT to_tsvector('english', 'The quick brown fox jumped over the lazy dog')  
  @@ to_tsquery('english', 'jumping');

Upvotes: 2

Related Questions