From sandy9940@rediffmail.com Thu Apr 29 13:26:00 2010 Received: from maia.hub.org (maia-4.hub.org [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 234A0633508 for ; Thu, 29 Apr 2010 10:26:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 11887-07 for ; Thu, 29 Apr 2010 13:25:45 +0000 (UTC) X-Greylist: delayed 00:06:38.263491 by SQLgrey-1.7.6 Received: from rediffmail.com (f4mail-235-146.rediffmail.com [202.137.235.146]) by mail.postgresql.org (Postfix) with SMTP id 74FDA63347C for ; Thu, 29 Apr 2010 10:25:43 -0300 (ADT) Received: (qmail 25506 invoked by uid 510); 29 Apr 2010 13:13:40 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=redf; d=rediffmail.com; b=Lk9zsxc0f7qSvwaBqea5Tax1pe/ADZpTZaAx4U+dv7sIGNBjoHi0XojkVyF29hr4YJsIwtFbSPqpaZJvGLthrvgt2mLbxPGV9MAStX5IesZoP1WrDPjA/dtoRCeZ8hR+wKcui3Hp/7KqAxd00MlTM3Y2Z9x2wHBnR0etq+Y1qos= ; X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: : 0 X-CTCH-RefID: str=0001.0A150203.4BD98745.0069,ss=1,fgs=0 Date: 29 Apr 2010 13:13:40 -0000 Message-ID: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com> MIME-Version: 1.0 To: , Received: from unknown 59.163.11.66 by rediffmail.com via HTTP; 29 Apr 2010 13:13:39 -0000 Subject: =?utf-8?B?VHNlYXJjaCBub3Qgc2VhcmNoaW5nICdZJw==?= From: "sandeep prakash dhumale" Content-Type: multipart/alternative; boundary="=_d1e08d0059852f3e816504096240898a" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.407 tagged_above=-10 required=5 tests=BAYES_50=0.8, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, HTML_IMAGE_ONLY_12=2.059, HTML_MESSAGE=0.001, HTML_SHORT_LINK_IMG_1=0.001, MSGID_FROM_MTA_HEADER=0.001, T_RP_MATCHES_RCVD=-0.01, UNPARSEABLE_RELAY=0.001 X-Spam-Level: **** X-Archive-Number: 201004/1069 X-Sequence-Number: 162267 --=_d1e08d0059852f3e816504096240898a Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="UTF-8" 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 --=_d1e08d0059852f3e816504096240898a Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="UTF-8"
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 ts= query.

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.

SELE= CT 'hollywood'::tsvector @@ to_tsquery('holl<y>:*');
?column?----------
t

Thanks in advance

--=_d1e08d0059852f3e816504096240898a-- From ktm@rice.edu Thu Apr 29 13:56:18 2010 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 From tgl@sss.pgh.pa.us Thu Apr 29 14:01:40 2010 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7B3F563345E; Thu, 29 Apr 2010 11:01:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 93893-04; Thu, 29 Apr 2010 14:01:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 552986329E5; Thu, 29 Apr 2010 11:01:33 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o3TE1V6t010740; Thu, 29 Apr 2010 10:01:31 -0400 (EDT) To: "sandeep prakash dhumale" cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: =?utf-8?B?VHNlYXJjaCBub3Qgc2VhcmNoaW5nICdZJw==?= In-reply-to: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com> References: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com> Comments: In-reply-to "sandeep prakash dhumale" message dated "29 Apr 2010 13:13:40 -0000" Date: Thu, 29 Apr 2010 10:01:31 -0400 Message-ID: <10739.1272549691@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.838 tagged_above=-10 required=5 tests=AWL=0.072, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/1074 X-Sequence-Number: 162272 "sandeep prakash dhumale" writes: > I am trying to get tsearch working for my application but I am facing a > problem when alphabet 'Y' is the in the tsquery. > # SELECT 'hollywood'::tsvector @@ to_tsquery('holly:*'); > ?column? > ---------- > f > (1 row) You can't use to_tsquery for this sort of thing, because it tries to normalize the given words: regression=# select to_tsquery('holly:*'); to_tsquery ------------ 'holli':* (1 row) If you do this it works: regression=# SELECT 'hollywood'::tsvector @@ 'holly:*'::tsquery; ?column? ---------- t (1 row) So if you want to use prefix matching, don't normalize. regards, tom lane From sandy9940@rediffmail.com Thu Apr 29 14:26:26 2010 Received: from maia.hub.org (maia-1.hub.org [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D69AB6332E7 for ; Thu, 29 Apr 2010 11:26:26 -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 36976-09 for ; Thu, 29 Apr 2010 14:26:06 +0000 (UTC) X-Greylist: delayed 00:06:38.67391 by SQLgrey-1.7.6 Received: from rediffmail.com (f4mail-235-238.rediffmail.com [202.137.235.238]) by mail.postgresql.org (Postfix) with SMTP id 0807E632CBB for ; Thu, 29 Apr 2010 11:26:14 -0300 (ADT) Received: (qmail 16426 invoked by uid 510); 29 Apr 2010 14:14:10 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=redf; d=rediffmail.com; b=QH1PUNntJsvAeiSOgwMryEPJ265v4dDRMa59g/WuuM7B9nKhzpk6AJDhLFnXbhU4PeZc9aoE3PxQYspo1mBUXllBWHJ7HW/e47lFCQSQFlU382ly2JNBocCj8wQdX+wigDxKonT0DI/fONvbaX3PcQ9QwzjU50TVvH4jC2ByIGI= ; X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: : 0 X-CTCH-RefID: str=0001.0A150205.4BD99573.00EB,ss=1,fgs=0 Date: 29 Apr 2010 14:14:10 -0000 MIME-Version: 1.0 To: Received: from unknown 59.163.11.66 by rediffmail.com via HTTP; 29 Apr 2010 14:14:10 -0000 Message-ID: <1272549453.S.4378.32318.f4mail-234-233.rediffmail.com.1272550450.8616@webmail.rediffmail.com> in-reply-to: <20100429135602.GM1610@aart.is.rice.edu> Subject: =?utf-8?B?UmU6IFJlOiBbR0VORVJBTF0gW1NRTF0gVHNlYXJjaCBub3Qgc2VhcmNoaW5nICdZJw==?= From: "sandeep prakash dhumale" Cc: , Content-Type: multipart/alternative; boundary="=_0f6c4945e9cfcfbe623c67aada30a75b" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.507 tagged_above=-10 required=5 tests=BAYES_05=-0.5, HTML_IMAGE_ONLY_32=0.001, HTML_MESSAGE=0.001, T_RP_MATCHES_RCVD=-0.01, UNPARSEABLE_RELAY=0.001 X-Spam-Level: X-Archive-Number: 201004/1079 X-Sequence-Number: 162277 --=_0f6c4945e9cfcfbe623c67aada30a75b Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="UTF-8" On Thu, 29 Apr 2010 19:27:33 +0530 wrote >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 > > >-- >Sent via pgsql-general mailing list (pgsql-general@postgresql.org) >To make changes to your subscription: >http://www.postgresql.org/mailpref/pgsql-general > 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  <y> in the query how does it work, does that mean to explicitly include y in to_tsquery. All your help is higly appriciated. --Sandy --=_0f6c4945e9cfcfbe623c67aada30a75b Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="UTF-8"

On Thu, 29 Apr 2010 19:27:33 +0530 wrote
>On T= hu, Apr 29, 2010 at 01:13:40PM -0000, sandeep prakash dhumale wrote:
>= ;> Hello All,
>>
>> I am trying to get tsearch workin= g for my application but I am facing a
>> problem when alphabet 'Y= ' is the in the tsquery.
>>
>> can anyone please share s= ome light on it.
>>
>>
>> # SELECT 'hollywood'= ::tsvector @@ to_tsquery('holly:*');
>> ?column?
>> -----= -----
>> f
>> (1 row)
>>
>> SELECT 'ho= llywood'::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_t= squery('holl<y>:*');
>> ?column?
>> ----------
&= gt;> t
>>
>> Thanks in advance
>
>That i= s because the to_tsquery() normalizes the tokens. Here is
>what I get= from the default configuration:
>
>db=3D# select to_tsquery('h= olly:*');
> to_tsquery
>------------
> 'holli':*
>= (1 row)
>
>db=3D# select to_tsquery('holl:*');
> to_tsque= ry
>------------
> 'holl':*
>(1 row)
>
>It i= s 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
>
>
>-- >Sent via pgsql-general mailing list (pgsql-= general@postgresql.org)
>To make changes to your subscription:>http= ://www.postgresql.org/mailpref/pgsql-general
>



Fir= st 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 b= y casting like you wrote then i ran into case sensitivity issue also then i= t does not work for other searches I guess then it sees for exact matches a= nd not normalize to lexims.

Ken: As you said I need to change my con= figuration, It would be great if you can point me out where i can change th= at configuration

and what about that  <y> in the query h= ow does it work, does that mean to explicitly include y in to_tsquery.
<= br>
All your help is higly appriciated.


--Sandy



--=_0f6c4945e9cfcfbe623c67aada30a75b-- From jsmgage@numericable.fr Thu Apr 29 17:48:40 2010 Received: from maia.hub.org (maia-1.hub.org [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 19A9963346E; Thu, 29 Apr 2010 14:48:40 -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 68698-06; Thu, 29 Apr 2010 17:48:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp5.tech.numericable.fr (smtp5.tech.numericable.fr [82.216.111.41]) by mail.postgresql.org (Postfix) with ESMTP id 4DB3A63330B; Thu, 29 Apr 2010 14:48:32 -0300 (ADT) Received: from [10.0.1.2] (abo-102-217-68.trs.modulonet.fr [85.68.217.102]) by smtp5.tech.numericable.fr (Postfix) with ESMTP id 3F77C12402F; Thu, 29 Apr 2010 19:48:29 +0200 (CEST) Cc: "sandeep prakash dhumale" , pgsql-sql@postgresql.org, pgsql-general@postgresql.org Message-Id: <4D5A9366-9110-4FA4-8445-E408E2C2FEE9@numericable.fr> From: John Gage To: Tom Lane In-Reply-To: <10739.1272549691@sss.pgh.pa.us> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [SQL] Tsearch not searching 'Y' Date: Thu, 29 Apr 2010 19:48:29 +0200 References: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com> <10739.1272549691@sss.pgh.pa.us> X-Mailer: Apple Mail (2.936) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.51 tagged_above=-10 required=5 tests=BAYES_05=-0.5, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/1094 X-Sequence-Number: 162292 You can avoid stemming by using 'simple' instead of 'english' as the language of the words in to_tsvector (which is a little more awkward than the cast). "There are no stop words for the simple dictionary. It will just convert to lower case, and index every unique word. SELECT to_tsvector('simple', 'Andy andy The the in out'); to_tsvector ------------------------------------- 'in':5 'out':6 'the':3,4 'andy':1,2 (1 row) John On Apr 29, 2010, at 4:01 PM, Tom Lane wrote: > "sandeep prakash dhumale" writes: >> I am trying to get tsearch working for my application but I am >> facing a >> problem when alphabet 'Y' is the in the tsquery. > >> # SELECT 'hollywood'::tsvector @@ to_tsquery('holly:*'); >> ?column? >> ---------- >> f >> (1 row) > > You can't use to_tsquery for this sort of thing, because it tries to > normalize the given words: > > regression=# select to_tsquery('holly:*'); > to_tsquery > ------------ > 'holli':* > (1 row) > > If you do this it works: > > regression=# SELECT 'hollywood'::tsvector @@ 'holly:*'::tsquery; > ?column? > ---------- > t > (1 row) > > So if you want to use prefix matching, don't normalize. > > regards, tom lane > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql