Received: from maia.hub.org (maia-1.hub.org [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id DA5BE633508; Thu, 29 Apr 2010 10:56:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 32567-09; Thu, 29 Apr 2010 13:55:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mh5.mail.rice.edu (mh5.mail.rice.edu [128.42.199.32]) by mail.postgresql.org (Postfix) with ESMTP id 06BD86323B2; Thu, 29 Apr 2010 10:56:04 -0300 (ADT) Received: from mh5.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh5.mail.rice.edu (Postfix) with ESMTP id 5BF8215C026; Thu, 29 Apr 2010 08:56:03 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.0 at mh5.mail.rice.edu Received: from mh5.mail.rice.edu ([127.0.0.1]) by mh5.mail.rice.edu (mh5.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xDYbpxFQlZHV; Thu, 29 Apr 2010 08:56:03 -0500 (CDT) Received: from aart.is.rice.edu (aart.is.rice.edu [168.7.56.48]) by mh5.mail.rice.edu (Postfix) with ESMTP id 3279D15C024; Thu, 29 Apr 2010 08:56:03 -0500 (CDT) Received: by aart.is.rice.edu (Postfix, from userid 18612) id D50402D5A1; Thu, 29 Apr 2010 08:56:02 -0500 (CDT) Date: Thu, 29 Apr 2010 08:56:02 -0500 From: Kenneth Marshall To: sandeep prakash dhumale Cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: [SQL] Tsearch not searching 'Y' Message-ID: <20100429135602.GM1610@aart.is.rice.edu> References: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/1072 X-Sequence-Number: 162270 On Thu, Apr 29, 2010 at 01:13:40PM -0000, sandeep prakash dhumale wrote: > Hello All, > > I am trying to get tsearch working for my application but I am facing a > problem when alphabet 'Y' is the in the tsquery. > > can anyone please share some light on it. > > > # SELECT 'hollywood'::tsvector @@ to_tsquery('holly:*'); > ?column? > ---------- > f > (1 row) > > SELECT 'hollywood'::tsvector @@ to_tsquery('holl:*'); > ?column? > ---------- > t > (1 row) > > > It works when i put <> in y as below but i don't want to do it that way. > > SELECT 'hollywood'::tsvector @@ to_tsquery('holl<y>:*'); > ?column? > ---------- > t > > Thanks in advance That is because the to_tsquery() normalizes the tokens. Here is what I get from the default configuration: db=# select to_tsquery('holly:*'); to_tsquery ------------ 'holli':* (1 row) db=# select to_tsquery('holl:*'); to_tsquery ------------ 'holl':* (1 row) It is pretty easy to see why you see the behavior that you do. Maybe you need to change your tsearch configuration to match what you expect to happen. Regards, Ken