du958642589
du958642589
2013-04-11 13:56

如果无法访问Solr,Apache-Solr是否会超时?

已采纳

I am using solr-php-client https://code.google.com/p/solr-php-client/

Does it have a timeout option that I can manually set? Because whenever Solr (webSolr) is unreachable, I'm having problems Even if the $solr->search() call is within a Try Catch block.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dongtuo5611 dongtuo5611 8年前

    always PING solr server before any insert/select/update/delete request

     $solr = new Apache_Solr_Service($hostname, $portname,$core);
    
     if(!$solr->ping())
     {
        echo "server not responding";
        exit;
     }
    
     $solr->search($basicQuery, $start_limit,$end_limit,$params);
    
    点赞 评论 复制链接分享