zoukankan      html  css  js  c++  java
  • client version is higher than daemon version (client is v.1.29 daemon is v.1.22)

    安装好coreseek,建了索引,启动了服务,用php建了一个test.php,用于测试;<?phpinclude_once('sphinxapi.php');//向搜索引擎发起请求

    $cl = new SphinxClient ();
    $cl->SetServer ( '10.10.10.10', 9312);
    //$cl->getLastError();
    //$cl -> getLastWarning();
    print_r($cl); $cl->SetConnectTimeout ( 3 ); $cl->SetArrayResult ( true ); $cl->SetMatchMode ( SPH_MATCH_ANY); $cl->SetSortMode ( SPH_SORT_ATTR_ASC,'rank' ); //以排名rank升序排列 $cl->SetLimits(0,2); $query_data = $cl->Query ( '小米', "*" ); ?>

    在A台机器执行的结果如下

    SphinxClient Object
    (
        [_host] => 10.10.10.10
        [_port] => 9312
        [_offset] => 0
        [_limit] => 20
        [_mode] => 0
        [_weights] => Array
            (
            )
    
        [_sort] => 0
        [_sortby] =>
        [_min_id] => 0
        [_max_id] => 0
        [_filters] => Array
            (
            )
    
        [_groupby] =>
        [_groupfunc] => 0
        [_groupsort] => @group desc
        [_groupdistinct] =>
        [_maxmatches] => 1000
        [_cutoff] => 0
        [_retrycount] => 0
        [_retrydelay] => 0
        [_anchor] => Array
            (
            )
    
        [_indexweights] => Array
            (
            )
    
        [_ranker] => 0
        [_maxquerytime] => 0
        [_fieldweights] => Array
            (
            )
    
        [_overrides] => Array
            (
            )
    
        [_select] => *
        [_error] =>
        [_warning] =>
        [_connerror] =>
        [_reqs] => Array
            (
            )
    
        [_mbenc] =>
        [_arrayresult] =>
        [_timeout] => 0
        [_path] =>
        [_socket] =>
    )

     在B台机器执行的结果如下:

    SphinxClient Object
    (
        [error] =>
        [warning] =>
    )

    通过PHP的调试信息,根本没有发现任何错误输出;请教了一个大神,他用 strace -s 1000 -f -o test.log php test.php ,分析 test.log ,发现了如下的错误

    google了一番,通过在A,B 两台执行php --ini ,php -m 发现A机器中有php的sphinx扩展,而B机器中没有,终于找到具体的原因了。将A机器中的sphinx扩展去掉,重启php-fpm,就ok 了。

    service php-fpm restart

  • 相关阅读:
    删除List集合中的元素你碰到过这样的陷阱吗?
    从spring框架中的事件驱动模型出发,优化实际应用开发代码
    SpringBoot启动原理及相关流程
    基于SpringBoot实现定时任务的设置(常用:定时清理数据库)
    C#开发中常用的加密解密方法
    http://go.microsoft.com/fwlink/?linkid问题
    移动端开发必须知道的小技巧
    工作中遇到的细节问题总结(二)
    redis分布式锁和消息队列
    join和wait
  • 原文地址:https://www.cnblogs.com/mingaixin/p/5013786.html
Copyright © 2011-2022 走看看