Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id BC74512DEACC for ; Mon, 23 Apr 2012 15:45:44 -0300 (ADT) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SMOGb-0003w5-VK for pgsql-admin@postgresql.org; Mon, 23 Apr 2012 18:45:43 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 23 Apr 2012 13:45:28 -0500 Message-Id: <4F955CEF020000250004724A@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Mon, 23 Apr 2012 13:45:19 -0500 From: "Kevin Grittner" To: "PG Admin" ,"A J" Subject: Re: Partial substrings in FTS References: <1335201010.30117.YahooMailNeo@web161501.mail.bf1.yahoo.com> In-Reply-To: <1335201010.30117.YahooMailNeo@web161501.mail.bf1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201204/123 X-Sequence-Number: 39459 A J wrote: > In FTS, how do I search for partial substrings that don't form a > English word. > Example, in the text: 'one hundred thirty four' I want to find > the records based on 'hun' > > SELECT to_tsvector('one hundred thirty four') @@ > to_tsquery('hun'); does not return anything. It sounds like trigrams might be a better fit for you than text search. http://www.postgresql.org/docs/9.1/static/pgtrgm.html -Kevin