Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

postgres full text search like operator

Tags:

postgresql

what is the query to use to search for text that matches the like operator.

I am asking about full text search query, which is of the form

 SELECT * FROM eventlogging WHERE description_tsv @@ plainto_tsquery('mess');   

I want results with "message" as well but right not it does not return anything

like image 734
user373201 Avatar asked Jan 03 '11 21:01

user373201


1 Answers

If I read the description in the manual correctly, you'll need to use to_tsquery() instead of plainto_tsquery together with a wildcard to allow prefix matching:

SELECT * 
FROM eventlogging 
WHERE description_tsv @@ to_tsquery('mess:*');
like image 113
a_horse_with_no_name Avatar answered Oct 31 '22 17:10

a_horse_with_no_name