斯芬克斯未能读取搜索响应


Sphinx failed to read searchd response

执行以下代码时出错。我正在使用SPhinx与PHP&MySQL。

  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一起管理狮身人面像。你知道问题的原因吗?

端口9306,通常是sphinx在sphinxQL打开的情况下侦听的端口。

确实建议您应该使用SphinxQL,而不是SphinxAPI。不建议使用SphinxAPI启动新项目。

没有特殊的客户端可以使用SphinxQL,您只需要使用任何旧的MySQL客户端。

mysql_*函数会起作用,或者更好的是mysqli,甚至pdo等。