Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.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搜索特定索引_Php_Search_Indexing_Sphinx - Fatal编程技术网

通过PHP脚本从多个索引中使用Sphinx搜索特定索引

通过PHP脚本从多个索引中使用Sphinx搜索特定索引,php,search,indexing,sphinx,Php,Search,Indexing,Sphinx,我有多个来源,比如说 及 索引src1{ ... } 索引src2{ ... } src1具有来自一个单独表的sql查询,src2具有基于另一个单独表的sql查询 现在,在PHP脚本中,如何指定要使用的索引器? 通常,在PHP脚本中,我们是这样编写的 $ss = new SphinxClient; $ss->setServer("localhost", 9312); $ss->setMatchMode(SPH_MATCH_ANY); 因为,没有提到正在使用的索引器。搜索两个索引(即

我有多个来源,比如说

及 索引src1{ ... } 索引src2{ ... }

src1具有来自一个单独表的sql查询,src2具有基于另一个单独表的sql查询

现在,在PHP脚本中,如何指定要使用的索引器? 通常,在PHP脚本中,我们是这样编写的

$ss = new SphinxClient;
$ss->setServer("localhost", 9312);
$ss->setMatchMode(SPH_MATCH_ANY);

因为,没有提到正在使用的索引器。搜索两个索引(即两个表)是没有用的。我想搜索索引src2(比如说),即第二个表中的数据。那么,如何在php脚本中指定sphinx只搜索特定的索引器。

查询调用包括要搜索的索引

$res = $cl->Query($query,"src1");

查询调用包括要搜索的索引

$res = $cl->Query($query,"src1");
对于一个索引(每个Barry Hunter)

对于一个查询的多个索引

$res = $cl->Query($query,"src1 src2 src3 src4");
对于一个索引(每个Barry Hunter)

对于一个查询的多个索引

$res = $cl->Query($query,"src1 src2 src3 src4");

这似乎是一个反复出现的问题