Tom Tom - 1 year ago 83
PHP Question

How PHP full text searh works or not really, boolean mode

I would like to ask more info about PHP ?BOOLEAN? fulltext search.

$searchquery=mysqli_query($dbconnect,"select *, MATCH(s.title,s.url, s.keyword, s.`desc`) AGAINST('$q' IN BOOLEAN MODE ) AS score from site s where MATCH(s.title, s.keyword, s.url, s.`desc`) AGAINST('$q' IN BOOLEAN MODE ).

Sample keywords, some China and Arabic and normal Europe

(Arabic works)السيارات
中国的房子 (not working)
Tädiauto (works) Tädid (doesn't work)
all without äõü'ss etc works(english) ()
Someone can explain me this

at the end I set my tables to utf8_general_ci, nothing changed.
I use
$keywords=htmlspecialchars($keywords, ENT_QUOTES, "UTF-8");

It makes me feel that not all words are searchable words with full text search?

I hope I am not crazy of doing too much PHP...

anyways because like (%keyword%) works there is no issue with the database, or is the match() against() a Mysql separate search program that needs something, this seems to be so random search engine. Nobody seems to know this, how Google does it, need to investigate this, if anyone out there can help with anything, TY.

Thank you!

Tom Tom
Answer Source

While I was searching a lot, never seen this suggestion, PHP:

mysqli_set_charset($dbconnect, 'utf8'); mysqli_query($dbconnect, "SET NAMES 'utf8';"); mysqli_query($dbconnect, "SET CHARACTER SET 'utf8';"); mysqli_query($dbconnect, "SET COLLATION_CONNECTION = 'utf8_unicode_ci';");

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download