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

From Tom Lane
Subject Re: Tsearch not searching 'Y'
Date
Msg-id 10739.1272549691@sss.pgh.pa.us
Whole thread Raw
In response to Tsearch not searching 'Y'  ("sandeep prakash dhumale" <sandy9940@rediffmail.com>)
Responses Re: [GENERAL] Tsearch not searching 'Y'  (John Gage <jsmgage@numericable.fr>)
List pgsql-sql
"sandeep prakash dhumale" <sandy9940@rediffmail.com> 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

pgsql-sql by date:

Previous
From: "sandeep prakash dhumale"
Date:
Subject: Tsearch not searching 'Y'
Next
From: "sandeep prakash dhumale"
Date:
Subject: Re: Re: [GENERAL] [SQL] Tsearch not searching 'Y'