sphinx no enabled local indexes to search
PHP 2022/9/6 21:19:28 点击:不统计
%77w%77%2E%66%6F%72%61%73%70%2E%63%6E
在做php调用搜索引擎sphinx时,sphinx返回False,无法知道什么原因。
后台通过sphinx 对象打印 debug信息 输出 no enabled local indexes to search
看代码:
<?php
require_once "sphinxapi.php";
$word="修";
$cl = new SphinxClient();
$cl->SetServer('localhost',9312);
$offset=10;
$pagesize=5;
$cl->SetLimits($offset, $pagesize,1000);
$cl->SetConnectTimeout (3);
$cl->SetArrayResult (true);
$cl->SetMaxQueryTime(3000);
#$cl->SetMatchMode(SPH_MATCH_ANY); 3版本以上就不再支持设置这个参数了
# 这里是核心问题,如果查询必须指定索引,如果没有指定索引,则输出error 为 no enabled local indexes to search,设置后问题解决
$res = $cl->Query($word,"test1");
var_dump($res);
$a = $cl->GetLastError(); # 这里是如果出现错误,就打印错误日志
var_dump($a);
学习www.网for站asp制.cn作
·上一篇:php.ini pdo_mysql无效 >> ·下一篇:laravel 跨域 >>