Home> CMS Tutorial> DEDECMS> body text

What should I do if DedeCMS GBK version installs sphinx full-text index and cannot query without results?

藏色散人
Release: 2020-01-13 09:27:51
Original
2235 people have browsed it

What should I do if DedeCMS GBK version installs sphinx full-text index and cannot query without results?

DedeCMS GBK version installation sphinx full-text index cannot be queried and there is no result. What should I do?

The following is a detailed analysis and introduction to the solution to the problem that the sphinx full-text index cannot be queried without results when the DedeCMS GBK version is installed. Friends in need can refer to the following

Recommended learning:伟梦cms

This test installed the Chinese version of sphinx-coreseek version 4.0. Use the test Chinese command to query on the command line:

echo 网络搜索 | iconv -f gbk -t utf-8 | search -c D:\webserver\coreseek-4.0.1-win32\etc\csft_dedecmsv57.conf --stdin | iconv -f utf-8 -t gbk
Copy after login

can be successfully queried.

But there is no result in DedeCms. After groping, I finally found the reason. The keyword editing in search.php of DedeCMS GBK version is GBK, and the sphinx full-text index requirement is utf8,

So GBK encoded Chinese cannot be queried;

Solution:

Open search.php in plus and find:

$keyword = addslashes(cn_substr($keyword,30));
Copy after login

Add below this line:

$keyword= mb_convert_encoding($keyword,"UTF-8", "GBK");
Copy after login

can be queried normally!

The above is the detailed content of What should I do if DedeCMS GBK version installs sphinx full-text index and cannot query without results?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!