Re: Tsearch not searching 'Y' - Mailing list pgsql-sql

From Kenneth Marshall
Subject Re: Tsearch not searching 'Y'
Date
Msg-id 20100429135602.GM1610@aart.is.rice.edu
Whole thread Raw
In response to Tsearch not searching 'Y'  ("sandeep prakash dhumale" <sandy9940@rediffmail.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: WAL-files restore and nextval('PK')
Next
From: John Gage
Date:
Subject: Re: [GENERAL] Tsearch not searching 'Y'