Home  >  Article  >  php教程  >  【原创】sphinx api调用出错后,如何调试

【原创】sphinx api调用出错后,如何调试

WBOY
WBOYOriginal
2016-06-06 20:11:161340browse

当我们在用coreseek或 单纯的sphinx时,如果我们在程序中调用api过程中,函数返回false,这种情况下该如何调试呢? 如: $res = $cl-Query($searchkey, 'myIndex');//var_dump($res);die; 如果Qquery出错,那么$res 只会返回false,而不会返回具体的错误信息

当我们在用coreseek或 单纯的sphinx时,如果我们在程序中调用api过程中,函数返回false,这种情况下该如何调试呢?
如:

$res = $cl->Query($searchkey, 'myIndex');
//var_dump($res);die;

如果Qquery出错,那么$res 只会返回false,而不会返回具体的错误信息的,这种情况下,我们可以用
GetLastError 方法来获取最后的具体出错信息!!

var_dump($cl->GetLastError());
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