xunsearch使用namespace后bug修复

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);前加一行php


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

至此问题解决
相关文章
相关标签/搜索