How to do a full-text search words within some proximity of each other?

From: "W(dot) Matthew Wilson" <matt(at)tplus1(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to do a full-text search words within some proximity of each other?
Date: 2012-09-24 13:33:15
Message-ID: CAGHfCUBTDGyP6oQLc+he7JO5h-r0YDHkzT55ORiLw-Y_5+F67A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I noticed in elastic search (ES), you can do queries like

"a b"~4

I think this query will match stuff like "a b" and "a x x b" but not
something like "a x x x x x x x x b".

I'm not sure if this kind of thing is possible with postgresql full
text search. Is it possible?

I understand that I can do a query and rank the results by how closely
the words are to each other, but I want to exclude any matches where
the words are not within two words of each other.

Thanks in advance!

Matt

--
W. Matthew Wilson
matt(at)tplus1(dot)com
http://tplus1.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vincent Dautremont 2012-09-24 13:38:12 Re: Windows Services and Postgresql 9.1.3
Previous Message Robert James 2012-09-24 13:32:42 Running CREATE only on certain Postgres versions