【发布时间】:2014-06-13 16:28:42
【问题描述】:
执行以下代码时出现错误。我正在使用带有 PHP 和 MySQL 的 SPhinx。
require ( "sphinxapi.php" );
$cl = new SphinxClient();
$cl->SetServer( "127.0.0.1", 9306 );
$cl->SetMatchMode( SPH_MATCH_ANY );
$cl->SetFilter( 'model', array( 3 ) );
$result = $cl->Query( 'is', 'the' );
if ( $result === false ) {
echo "Query failed: " . $cl->GetLastError() . ".\n";
}
else {
if ( $cl->GetLastWarning() ) {
echo "WARNING: " . $cl->GetLastWarning() . "";
}
if ( ! empty($result["matches"]) ) {
foreach ( $result["matches"] as $doc => $docinfo ) {
echo "$doc\n";
}
print_r( $result );
}
}
exit;
收到此错误
Deprecated: DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API in C:\xampp\htdocs\sphinx\sphinxapi.php on line 764
failed to read searchd response (status=2610, ver=11826, len=775040361, read=61).
我正在使用 Wamp 运行 Sphinx。 关于问题原因的任何想法?
【问题讨论】:
-
第 764 行是哪一行?该消息似乎非常具有描述性,您需要使用
SphinxQL而不是您在此行中使用的任何内容... -
谷歌搜索,但我没有得到文件 SphinxQL
标签: php mysql search-engine sphinx