From: Kenneth Marshall <ktm@rice.edu>
To: sandeep prakash dhumale <sandy9940@rediffmail.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [SQL] Tsearch not searching 'Y'
Date: Thu, 29 Apr 2010 08:56:02 -0500
Message-ID: <20100429135602.GM1610@aart.is.rice.edu> (raw)
In-Reply-To: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com>
References: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ktm@rice.edu, sandy9940@rediffmail.com, pgsql-general@postgresql.org
Subject: Re: [SQL] Tsearch not searching 'Y'
In-Reply-To: <20100429135602.GM1610@aart.is.rice.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox