POST TIME:2017-11-13 00:49
本测试安装的是sphinx中文版-coreseek 4.0版,用测试中文的命令在命令行查询:
- echo网络搜索|iconv-fgbk-tutf-8|search-cD:\webserver\coreseek-4.0.1-win32\etc\csft_dedecmsv57.conf--stdin|iconv-futf-8-tgbk
可成功查询。
但在DedeCms中却无结果,经过摸索,终于找到原因,DedeCMS GBK版的search.php中的关键字编辑是GBK的,而sphinx全文索引要求是utf8,
所以无法查询GBK编码的中文;
解决方法:
打开plus中的search.php , 找到:
- $keyword=addslashes(cn_substr($keyword,30));
在这行下面增加:
- $keyword=mb_convert_encoding($keyword,"UTF-8","GBK");
即可正常查询!