From: Tom Lane <tgl@sss.pgh.pa.us>
To: vtamara@pasosdeJesus.org
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13690: Full Text Search with spanish dictionary cannot find some words
Date: Tue, 20 Oct 2015 09:21:38 -0700
Message-ID: <33158.1445358098@sss.pgh.pa.us> (raw)
In-Reply-To: <20151020110857.3017.63066@wrigleys.postgresql.org>
References: <20151020110857.3017.63066@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
vtamara@pasosdeJesus.org writes:
> The following search in english succeeds (returns 1):
> SELECT COUNT(*) FROM cat
> WHERE to_tsvector('english', nombre) @@ to_tsquery('english',
> 'politi:*'
> );
> But fails using the spanish dictionary (returns 0):
> SELECT COUNT(*) FROM cat
> WHERE to_tsvector('spanish', nombre) @@ to_tsquery('spanish',
> 'politi:*'
> );
This is because you didn't adjust the wildcard search pattern for the
different stemming rules used in Spanish. Look at the to_tsvector and
to_tsquery results:
regression=# SELECT to_tsvector('english', nombre) , to_tsquery('english','politi:*') from cat;
to_tsvector | to_tsquery
-------------------------+------------
'politica':1 'social':2 | 'politi':*
(1 row)
regression=# SELECT to_tsvector('spanish', nombre) , to_tsquery('spanish','politi:*') from cat;
to_tsvector | to_tsquery
----------------------+------------
'polit':1 'social':2 | 'politi':*
(1 row)
I don't know enough Spanish to follow the reasoning for stemming
"politica" as "polit" rather than something else; but I do see that
"politi" is not reduced to "polit", which is fairly reasonable since
that's not a word. "politi:*" will match anything whose stemmed
version starts with "politi", but that's too long ...
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, vtamara@pasosdeJesus.org
Subject: Re: BUG #13690: Full Text Search with spanish dictionary cannot find some words
In-Reply-To: <33158.1445358098@sss.pgh.pa.us>
References: <20151020110857.3017.63066@wrigleys.postgresql.org> <33158.1445358098@sss.pgh.pa.us>
* 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