How to solve the problem that sphinx full-text index can not be queried without results when installing sphinx in DedeCMS GBK version
Editor to share with you how to solve the DedeCMS GBK version of the installation of sphinx full-text index can not query the problem of no results, I hope you will learn a lot after reading this article, let's discuss it together!
DedeCMS GBK version of the installation of sphinx full-text index can not query no results?
The following is a detailed analysis and introduction of the solution that the DedeCMS GBK version of sphinx full-text index can not be queried without results. Friends who need it can refer to it.
Recommended study: dream weaving cms
This test installs sphinx Chinese version-coreseek version 4.0. use the test Chinese command to query on the command line:
Echo Network search | 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 queried successfully.
But there is no result in DedeCms. After groping, we finally find the reason. The keyword editor in DedeCMS GBK version of search.php is GBK, while the requirement of sphinx full-text index is utf8.
Therefore, it is not possible to query the GBK encoded Chinese.
Solution:
Open search.php in plus and find:
$keyword = addslashes (cn_substr ($keyword,30))
Add under this line:
$keyword= mb_convert_encoding ($keyword, "UTF-8", "GBK")
You can inquire normally!
After reading this article, I believe you have a certain understanding of how to solve the problem that the DedeCMS GBK version of the sphinx full-text index cannot be queried without results. Want to know more about it. Welcome to follow the industry information channel. Thank you for your reading!