1

Let's say I want to search "Mad Max" and I only want results wherein 'Max' follows 'Mad'. That is:

Mad Max is a good movie. ==> matched!
Max is not mad in the movie. ===> not matched.

It looks like it is something not mentioned in the documents. Did I miss anything?

Innerpeacer
  • 1,321
  • 12
  • 20
  • 4
    Support for phrase search was added with the just released version 9.6: https://www.postgresql.org/docs/current/static/release-9-6.html see also here: http://stackoverflow.com/a/25007405/330315 –  Oct 14 '16 at 07:30
  • That's great! I was looking at the 9.5 docs. Thanks @a_horse_with_no_name – Innerpeacer Oct 15 '16 at 00:36

1 Answers1

0

For later reference.

SELECT to_tsvector('fatal error') @@ to_tsquery('fatal <-> error');
 ?column? 
----------
 t

SELECT to_tsvector('error is not fatal') @@ to_tsquery('fatal <-> error');
 ?column? 
----------
 f

https://www.postgresql.org/docs/9.6/static/textsearch-intro.html#TEXTSEARCH-MATCHING

Innerpeacer
  • 1,321
  • 12
  • 20