xunsearch使用namespace后bug修复

来源:互联网 发布:搜衣服的软件 编辑:程序博客网 时间:2024/05/29 10:39
xunsearch在使用了namespace后会出现不能正常使用
错误如下:
Fatal error: Uncaught [vendors\xunsearch\lib\XSException] ../vendors/xunsearch/lib/XS.php(972): Undefined custom tokenizer `full' for field 

解决方法如下:
找到XS.php文件中的public function getCustomTokenizer()修改其中的class_exists函数调用等部分如下
if (!class_exists( __NAMESPACE__ . '\\' . $name)) {

在$obj = $arg === null ? new $name : new $name($arg);前加一行

$name = __NAMESPACE__ . '\\' . $name;

至此问题解决

0 0
原创粉丝点击