Search Postgresql Archives

Re: Tsearch not searching 'Y'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"sandeep prakash dhumale" <sandy9940@xxxxxxxxxxxxxx> 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-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux