| Mailing List | | Home | | MySQL General - General MySQL discussion | | MaxDB - Everything about MaxDB, formerly known as SAP DB | | MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP | | Java Help - Mostly related to the MySQL Connector/J driver | | ODBC - ODBC with the MySQL Connector/ODBC driver | | Perl - Perl support for MySQL with DBI and DBD::mysql | | MySQL++ - Programming with the C++ API to MySQL |
|
|
  | |  | latin1 accented characters and fulltext | latin1 accented characters and fulltext 2004-03-16 - By mark warren bracher
Back I 've been playing around with fulltext searching in 4.0, and I ran into
the following weirdness with accented characters.
| version | 4.0.14
|
character_set | latin1
in my entire collection, there is just one row with the keyword
'angélica ' with the accent, several others without. a fulltext search
for 'angélica ' returns all of them. it 's almost as if mysql knows what
the base unaccented character is, and is performing some normalization
before searching. but I couldn 't find this documented anywhere (tried a
search for 'accented character fulltext ', nothing looked relevant).
I don 't think I _mind_ the behavior. In fact it may actually save me
jumping through some hoops in order to meet functional requirements, but
I just didn 't _expect_ it...
- mark
drop table test_search;
create table test_search (
artist_id integer not null,
lang_code char(5) not null,
name varchar(255) not null,
keywords varchar(255) not null,
primary key ( artist_id, lang_code ),
fulltext ( keywords )
) type=myisam;
insert into test_search values ( 740273, 'en-us ', 'Angelica ', 'Angelica ' );
insert into test_search values ( 783679, 'en-us ', 'Angelica Garcia ',
'Angelica Garcia ' );
insert into test_search values ( 756774, 'en-us ', 'Angélica Vale ',
'Angelica Angélica Vale ' );
insert into test_search values ( 751119, 'en-us ', 'Electric Junkyard ',
'Electric Junkyard ' );
insert into test_search values ( 774590, 'en-us ', 'Moncho ', 'Moncho ' );
select artist_id,lang_code,name,keywords
FROM test_search
WHERE match(keywords) against ( 'angélica ' in boolean mode)
ORDER BY name asc
+-- ---- ---+-- ---- ---+-- ---- ---- ----+-- ---- ---- ---- ------+
| artist_id | lang_code | name | keywords |
+-- ---- ---+-- ---- ---+-- ---- ---- ----+-- ---- ---- ---- ------+
| 740273 | en-us | Angelica | Angelica |
| 783679 | en-us | Angelica Garcia | Angelica Garcia |
| 756774 | en-us | Angélica Vale | Angelica Angélica Vale |
+-- ---- ---+-- ---- ---+-- ---- ---- ----+-- ---- ---- ---- ------+
3 rows in set (0.00 sec)
--
MySQL General Mailing List
For list archives:
http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=mysql
@(protected)
|
|
 |