我正在尝试使用LEFT JOIN在2个表上进行MATCH
`jos_application_listing` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` text NOT NULL,
`headline` text NOT NULL,
`city` bigint(20) NOT NULL,
`state` varchar(500) NOT NULL,
`country` varchar(500) NOT NULL,
`features` text NOT NULL,
`listing_type` bigint(20) NOT NULL,
`phone` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`website` varchar(1000) NOT NULL,
`pictures` mediumtext,
`address` varchar(100) NOT NULL DEFAULT '',
`postal` varchar(25) NOT NULL DEFAULT '',
`category` bigint(20) NOT NULL,
`sub_category` bigint(20) NOT NULL,
`latitude` float NOT NULL,
`longitude` float NOT NULL,
`listing_expire` varchar(255) NOT NULL DEFAULT 'normal',
`featured_till` datetime NOT NULL,
`facebook` text NOT NULL,
`video` text NOT NULL,
`video_size` text NOT NULL,
`business_hours` text NOT NULL,
`published` tinyint(4) NOT NULL,
`featured` tinyint(4) NOT NULL,
`UID` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
`jos_application_cities` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`city` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM CHARSET=utf8;
INDEX - > > >
我在jos_application_listing上有一个完整的文本索引(名称,标题,描述)
和
我在jos_application_cities(city)上有一个完整的文本索引
QUERY - > > >
SELECT * FROM jos_lnzon_listing
LEFT JOIN jos_lnzon_cities ON jos_lnzon_listing.city = jos_lnzon_cities.id
WHERE MATCH (name,headline,description,jos_lnzon_listing.city)
AGAINST ('" . $searchQuery . "' IN BOOLEAN MODE)";
我看不到问题,但是我收到以下错误:
1271 - 操作“匹配”的非法混合排序SQL = SELECT * FROM jos_lnzon_listing LEFT JOIN jos_lnzon_cities ON jos_lnzon_listing.city = jos_lnzon_cities.id WHERE MATCH(name,headline,description,jos_lnzon_listing.city)AGAINST('+ search term '在布尔模式中)
答案 0 :(得分:1)
我对排序错误的体验通常是由于字符编码不匹配造成的 - 您是否尝试过明确地将连接字符集设置为UTF-8?
http://php.net/manual/en/mysqli.set-charset.php
我不知道在Joomla内做起来有多容易,我担心:(。
您还可以检查列的排序规则,看它们确实是所有UTF-8:https://stackoverflow.com/a/10014869/994291。