Re: Re: [GENERAL] [SQL] Tsearch not searching 'Y'

From: "sandeep prakash dhumale" <sandy9940(at)rediffmail(dot)com>
To: <ktm(at)rice(dot)edu>
Cc: <pgsql-sql(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Re: [GENERAL] [SQL] Tsearch not searching 'Y'
Date: 2010-04-29 14:14:10
Message-ID: 1272549453.S.4378.32318.f4mail-234-233.rediffmail.com.1272550450.8616@webmail.rediffmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On Thu, 29 Apr 2010 19:27:33 +0530 wrote
&gt;On Thu, Apr 29, 2010 at 01:13:40PM -0000, sandeep prakash dhumale wrote:
&gt;&gt; Hello All,
&gt;&gt;
&gt;&gt; I am trying to get tsearch working for my application but I am facing a
&gt;&gt; problem when alphabet 'Y' is the in the tsquery.
&gt;&gt;
&gt;&gt; can anyone please share some light on it.
&gt;&gt;
&gt;&gt;
&gt;&gt; # SELECT 'hollywood'::tsvector @@ to_tsquery('holly:*');
&gt;&gt; ?column?
&gt;&gt; ----------
&gt;&gt; f
&gt;&gt; (1 row)
&gt;&gt;
&gt;&gt; SELECT 'hollywood'::tsvector @@ to_tsquery('holl:*');
&gt;&gt; ?column?
&gt;&gt; ----------
&gt;&gt; t
&gt;&gt; (1 row)
&gt;&gt;
&gt;&gt;
&gt;&gt; It works when i put &lt;&gt; in y as below but i don't want to do it that way.
&gt;&gt;
&gt;&gt; SELECT 'hollywood'::tsvector @@ to_tsquery('holl&lt;y&gt;:*');
&gt;&gt; ?column?
&gt;&gt; ----------
&gt;&gt; t
&gt;&gt;
&gt;&gt; Thanks in advance
&gt;
&gt;That is because the to_tsquery() normalizes the tokens. Here is
&gt;what I get from the default configuration:
&gt;
&gt;db=# select to_tsquery('holly:*');
&gt; to_tsquery
&gt;------------
&gt; 'holli':*
&gt;(1 row)
&gt;
&gt;db=# select to_tsquery('holl:*');
&gt; to_tsquery
&gt;------------
&gt; 'holl':*
&gt;(1 row)
&gt;
&gt;It is pretty easy to see why you see the behavior that you do.
&gt;Maybe you need to change your tsearch configuration to match what
&gt;you expect to happen.
&gt;
&gt;Regards,
&gt;Ken
&gt;
&gt;
&gt;--
&gt;Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
&gt;To make changes to your subscription:
&gt;http://www.postgresql.org/mailpref/pgsql-general
&gt;

First of all thanks for your replies Tom and Ken,

I am little newbie to Tsearch so I appologies if I sound a little confuse.

Tom: If i do by casting like you wrote then i ran into case sensitivity issue also then it does not work for other searches I guess then it sees for exact matches and not normalize to lexims.

Ken: As you said I need to change my configuration, It would be great if you can point me out where i can change that configuration

and what about that&nbsp; &lt;y&gt; in the query how does it work, does that mean to explicitly include y in to_tsquery.

All your help is higly appriciated.

--Sandy

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-04-29 14:16:03 Re: using between with dates
Previous Message Adrian Klaver 2010-04-29 14:11:00 Re: using between with dates

Browse pgsql-sql by date

  From Date Subject
Next Message John Gage 2010-04-29 17:48:29 Re: [SQL] Tsearch not searching 'Y'
Previous Message Tom Lane 2010-04-29 14:01:31 Re: Tsearch not searching 'Y'