pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Gage <jsmgage@numericable.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: 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 19:48:29 +0200
Message-ID: <4D5A9366-9110-4FA4-8445-E408E2C2FEE9@numericable.fr> (raw)
In-Reply-To: <10739.1272549691@sss.pgh.pa.us>
References: <20100429131340.25498.qmail@f4mail-235-146.rediffmail.com>
	<10739.1272549691@sss.pgh.pa.us>

You can avoid stemming by using 'simple' instead of 'english' as the  
language of the words in to_tsvector (which is a little more awkward  
than the cast).

"There are no stop words for the simple dictionary. It will just  
convert to lower case, and index every unique word.
SELECT to_tsvector('simple', 'Andy andy The the in out');
  to_tsvector
  -------------------------------------
  'in':5 'out':6 'the':3,4 'andy':1,2
(1 row)

John


On Apr 29, 2010, at 4:01 PM, Tom Lane wrote:

> "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
>
> -- 
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql




view thread (5+ messages)

Message-ID: <4D5A9366-9110-4FA4-8445-E408E2C2FEE9@numericable.fr>
Permalink:  ../4D5A9366-9110-4FA4-8445-E408E2C2FEE9@numericable.fr/
Also on:    postgresql.org/message-id/4D5A9366-9110-4FA4-8445-E408E2C2FEE9@numericable.fr

 · 

reply

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: jsmgage@numericable.fr, tgl@sss.pgh.pa.us, sandy9940@rediffmail.com, pgsql-general@postgresql.org
  Subject: Re: [SQL] Tsearch not searching 'Y'
  In-Reply-To: <4D5A9366-9110-4FA4-8445-E408E2C2FEE9@numericable.fr>

* 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