Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Sphinx-在配置中使用多个sql属性_Php_Api_Full Text Search_Sphinx - Fatal编程技术网

Php Sphinx-在配置中使用多个sql属性

Php Sphinx-在配置中使用多个sql属性,php,api,full-text-search,sphinx,Php,Api,Full Text Search,Sphinx,在配置文件中,每个索引需要使用两个sql属性值。我在之前的一篇文章中发现,不要通过命令行对搜索命令过于信任。 我当前的问题是,当PHP API访问时,我可以检索两个sql属性值(但是,当通过命令行使用搜索时,两个sql属性值都会出现) 下面是我的配置文件。。 通过PHPAPI获取结果时,我只能看到sql属性表id,而不能看到名为pub属性的sql属性表id 有人能提出它为什么会这样做吗 $cl = new SphinxClient(); $cl->SetServer($CONF['sp

在配置文件中,每个索引需要使用两个sql属性值。我在之前的一篇文章中发现,不要通过命令行对搜索命令过于信任。

我当前的问题是,当PHP API访问时,我可以检索两个sql属性值(但是,当通过命令行使用搜索时,两个sql属性值都会出现)

下面是我的配置文件。。

通过PHPAPI获取结果时,我只能看到sql属性表id,而不能看到名为pub属性的sql属性表id

有人能提出它为什么会这样做吗

$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);

我猜你不是在重新启动搜索引擎。您仍然需要使用旧索引

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

没有做到这一点。完全停止搜索,重新索引索引并启动干净的启动

(您的语法正确,正在进行其他操作)

谢谢!!旋转成功了,我正在手动操作(删除数据文件夹,做索引器等等),太棒了--旋转绝对是最好的方式。它非常适合在crontab中定期重新编制索引。它启动了一个干净的重新加载,不应该中断一个实时服务守护进程。