我想执行搜索以搜索两种语言。我在查询中使用COLLATE utf8_unicode_ci
来执行此操作。
例如,我想搜索“ağaç”。它不起作用,而且我收到警告; Warning: COLLATION 'utf8_unicode_ci' is not valid for CHARACTER SET 'latin1'
但我的字符集不是latin1
,我正在使用utf8_turkish_ci
我基本上想要做的是搜索“agac”和“ağaç”。
这是我的查询
$searchQ = "select ".$options.", ".DB_PREFIX."users.name as owner,
MATCH (title,description,tags) AGAINST ('".$searchKey."' IN BOOLEAN MODE) AS relevance,
MATCH (title) AGAINST ('".$searchKey."' IN BOOLEAN MODE) AS title_relevance FROM ".DB_PREFIX."videos LEFT JOIN ".DB_PREFIX."users ON ".DB_PREFIX."videos.user_id = ".DB_PREFIX."users.id
WHERE MATCH (title,description,tags) AGAINST('".$searchKey."' IN BOOLEAN MODE) AND ".DB_PREFIX."videos.pub > 0 and ".DB_PREFIX."videos.date < now() $interval COLLATE utf8_unicode_ci ORDER by title_relevance DESC,relevance DESC ".this_limit();
提前致谢