【问题标题】:Sphinx - Using multiple sql_attr_uint in configurationSphinx - 在配置中使用多个 sql_attr_uint
【发布时间】:2012-11-02 14:38:13
【问题描述】:

我需要在我的配置文件中为每个索引使用两个 sql_attr_uint 值。我从上一篇文章中发现不要对通过命令行的搜索命令过于相信。 Sphinx PHP API order differs from Search Daemon

我当前的问题是,当被 P​​HP API 访问时,我无法检索这两个 sql_attr_uint 值(但是,当通过命令行使用搜索时,两个 sql_attr_uint 值都会出现)

下面是我的配置文件.. http://pastebin.com/30Si7bw5

通过 PHP API 获取结果时,我只能看到 sql_attr_uint table_id,但看不到名为 pub_id 的 sql_attr_uint。

谁能建议它为什么会这样做?

$cl = new SphinxClient();
$cl->SetServer($CONF['sphinx_host'], $CONF['sphinx_port']);
$cl->SetMatchMode($mode);
$cl->SetLimits(0, 1000);
// below line commented out atm - to only show those rows with this sql_attr_uint of 760 (is this the correct syntax?)
//$cl->SetFilter ( 'pub_id', array(760), FALSE );
$result = $cl->Query($q);

【问题讨论】:

    标签: php api full-text-search sphinx


    【解决方案1】:

    我猜你并没有重新启动 searchd 。您仍然使用旧索引。

    重新索引时,请确保使用 --rotate 以使 searchd 重新加载。

    失败了。完全停止 searchd,重新索引索引并启动干净启动。

    (你的语法是正确的,还有其他事情发生)

    【讨论】:

    • 谢谢!! --rotate 工作,我是手动做的(删除数据文件夹,做索引器 --all 等)
    • 啊太棒了。 --rotate 绝对是最好的方法。它非常适合在 crontab 中使用以定期重新索引。它启动了一个很好的干净重新加载,不应该中断实时服务守护进程。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-02
    • 2016-07-21
    相关资源
    最近更新 更多