How to match a UTF-8 field with acute vowels words in "BOOLEAN MODE"?
Posted by:
Date: October 08, 2007 02:58AM
Hi.
Using mySQL 4.1.22, I'd like to carry out an SQL query to find a
string containing acute vowels.
mytable:
- item1:
--- firstname: Antonio
--- lastname: Fernández
--- comments: he's from Spain
My SQL query:
------
SELECT id FROM mytable WHERE MATCH(firstname, lastname, comments)
AGAINST ('+"fernandez"' IN BOOLEAN MODE) ORDER BY firstname, lastname
--------
If mytable is in latin1, it works fine. But if mytable is in utf8
(it's the case) it doesn't work. How can I change my SQL query to
match 'Fernández' in UTF8 within the table?
My ft configuration in /etc/my.conf:
------
ft_min_word_len=1
ft_stopword_file=''
-----
I tried also adding these two lines after DB connection (PHP code):
-------
mysql_query ("SET NAMES utf8;");
mysql_query ("SET CHARACTER_SET utf8;");
------
but it won't work :(
Thank you very much.
Subject
Views
Written By
Posted
How to match a UTF-8 field with acute vowels words in "BOOLEAN MODE"?
4854
October 08, 2007 02:58AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.