From: vtamara@pasosdeJesus.org
To: pgsql-bugs@postgresql.org
Subject: BUG #13690: Full Text Search with spanish dictionary cannot find some words
Date: Tue, 20 Oct 2015 11:08:57 +0000
Message-ID: <20151020110857.3017.63066@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 13690
Logged by: Vladimir Támara Patiño
Email address: vtamara@pasosdeJesus.org
PostgreSQL version: 9.4.5
Operating system: adJ/OpenBSD
Description:
Consider the following table with one register:
CREATE TABLE cat (
nombre character varying(500)
);
INSERT INTO cat (nombre) VALUES ('Politica Social');
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:*'
);
In all the cases I tried, the search with the english dictionary succeeded.
However using the spanish dictionary the search will succed for example with
'poli', 'polit', 'politica' but will fail with 'politi' and 'politic'
I'm using the dictionary of stop words included with PostgreSQL 9.4.5.
I also tested in a PostgreSQL 9.1.12 running on a Linux Ubuntu 15.04, and I
observed exactly the same error using spanish dictionary (can find 'polit'
and 'politica' but cannot find 'politi' neither 'politic').
Here is the SQL I'm using for testing:
CREATE TABLE cat (
nombre character varying(500)
);
INSERT INTO cat (nombre) VALUES ('Politica Social');
SELECT COUNT(*) FROM cat
WHERE to_tsvector('spanish', nombre) @@ to_tsquery('spanish',
'polit:*');
SELECT COUNT(*) FROM cat
WHERE to_tsvector('english', nombre) @@ to_tsquery('english',
'polit:*');
SELECT COUNT(*) FROM cat
WHERE to_tsvector('spanish', nombre) @@ to_tsquery('spanish',
'politi:*'); -- Error gives 0 should be 1
SELECT COUNT(*) FROM cat
WHERE to_tsvector('english', nombre) @@ to_tsquery('english',
'politi:*');
SELECT COUNT(*) FROM cat
WHERE to_tsvector('spanish', nombre) @@ to_tsquery('spanish',
'politic:*'); -- Error gives 0 should be 1
SELECT COUNT(*) FROM cat
WHERE to_tsvector('english', nombre) @@ to_tsquery('english',
'politic:*');
SELECT COUNT(*) FROM cat
WHERE to_tsvector('spanish', nombre) @@ to_tsquery('spanish',
'politica:*');
SELECT COUNT(*) FROM cat
WHERE to_tsvector('english', nombre) @@ to_tsquery('english',
'politica:*');
--
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: vtamara@pasosdeJesus.org
Subject: Re: BUG #13690: Full Text Search with spanish dictionary cannot find some words
In-Reply-To: <20151020110857.3017.63066@wrigleys.postgresql.org>
References: <20151020110857.3017.63066@wrigleys.postgresql.org>
* 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