Skip site navigation (1) Skip section navigation (2)

Re: BUG #4148: tsearch related issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "" <dksingh(dot)engineer(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4148: tsearch related issue
Date: 2008-05-07 15:09:43
Message-ID: 7422.1210172983@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"" <dksingh(dot)engineer(at)gmail(dot)com> writes:
> for query SELECT to_tsvector('surprise') it's showing result as 'surpris':1
> but when I try to search this word its returning false.

> SELECT to_tsvector('surprise') @@ to_tsquery('surpris');

This isn't a bug, because those are not the same word.  If you looked
closer, you'd find:

regression=# SELECT to_tsvector('surprise') , to_tsquery('surpris');
 to_tsvector | to_tsquery 
-------------+------------
 'surpris':1 | 'surpri'
(1 row)

If you want to put in already-stemmed words, don't feed them through
to_tsquery, just cast directly to tsquery:

regression=# SELECT to_tsvector('surprise') @@ 'surpris'::tsquery;
 ?column? 
----------
 t
(1 row)


			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Eugen.KonkovDate: 2008-05-07 16:15:58
Subject: Re: BUG: aliases does not work ((
Previous:From: Bruce MomjianDate: 2008-05-07 14:42:55
Subject: Re: BUG #4024: xpath() results lose namespace mappings

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group