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

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

藏色散人
藏色散人Original
2020-01-13 09:27:512378browse

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

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));

Add below this line:

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

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!

Statement:
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