...uid = $_GET['uid']; $tag = $_GET['tag']; $xs = new XS('demo'); $search = $xs->search; $search->setCharset('UTF-8'); $search->setQuery('uid:' . $uid); $docs = $search->search(); $terms = $search->getExpandedQuery($tag); 然后对...
...个demo项目,搜索的时候显示: 错误:Object id #9 打印出search.php捕获到的异常,显示 [XSException] ../../../../../usr/local/xunsearch/sdk/php/lib/XS.php(2165): Failed to recv the data from server completely (SIZE:0/8, REASON:closed) #0 /usr/local/xunsearch/sdk/php/lib/...
一般过程: 1、实例化得到$xs = new Xs('xxx); 2、得到XSSearch实例,$search = $xs->search; 3、$search->setQuery('xxxxxxxx); 4、增加一系列的条件addRange 5、搜索前统计数量用于分页$total = $search->count(); 6、设置分页$search->setLimit(xxx,xxx); 7、取...
$xs = new XS('my_test'); // $query = $xs->search->setQuery(); $search = $xs->search; $search->query = ''; $count = $search->addRange('price',600,1000)->count(); $search->addRange('price',600,1000)->search(); $count2 = $search->getLastCount(); echo $xs->sea...
...怀疑是这么多字段索引造成的压力 [php]$xs=new XS('shi'); $search=$xs->search; $docs=$search->setQuery($keyword)->setLimit(12,($list_page-1)*12)->search(); $count=$search->getLastCount(); $time=$search->setQuery($keyword)->setSort('time')->setLimit(22)->search();[/php] 不知这样...
$search->setCharset('gbk'); 无效,输出来的还是uft-8;求助我错在那里? require '/usr/local/xunsearch/sdk/php/lib/XS.php'; $xs = new XS('allsource'); // 建立 XS 对象,项目名称为:demo $search = $xs->search; // 获取 搜索对象 $query = '部分'; // 这里的搜...
... [php] $xs = new XS('demo'); // 建立 XS 对象,项目名称为:demo $search=$xs->search; $search->setAutoSynonyms(true); $index->addSynonym('搜索','检索'); $index->addSynonym('搜索','查找'); [/php] 然后查看是否成功 [php] $xs = new XS('demo'); // 建立 XS 对象,项目名称...
各位好,今天我在执行search代码时报错:[XSException] ThinkPHP/Extend/Vendor/sdk/php/lib/XS.php(2160): Failed to recv the data from server completely (SIZE:0/8, REASON:closed); 以前都好的,我看了下论坛里以前的错误,是在 $xs = new XS(VENDOR_PATH.'sdk/php/app/'.$...
...th tokenizer = full 2. 导入相关数据 require_once '/usr/local/xunsearch/sdk/php/lib/XS.php'; $xs = new XS('goods'); $data = array( 'goods_id' => 112, 'goods_name' => 'hello my goodsname', 'goods_sn' => 'RX8899-114' ); $doc = new XSDocument; $doc->setFields($...
oh 谢谢!我试试[hr] require_once '/mnt/search/sdk/php/lib/XS.php'; $xs = new XS('test'); $skey = $_GET["skey"]; $search = $xs->search; $docs = $search->setQuery($skey."type:1")->search(); print_r($docs); 已经 [type] type = string index = self 了 但是搜索不到什么 改成...