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

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

WBOY
Release: 2016-06-06 20:11:16
Original
1402 people have browsed it

当我们在用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;
Copy after login

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

var_dump($cl->GetLastError());
Copy after login
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template