$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...
你好,我在使用xunsearch在yii里面使用的时候查找没有返回结果: Yii::app()->search->setQuery('subject:标题'); $docs = Yii::app()->search->setLimit(5, 10)->search(); $count = Yii::app()->search->count(); foreach ($docs as $doc) { echo $doc->rank() . '. ' . $doc...
例如: $query = $xs->search->setQuery($keyword); if ($c1) { $query->addRange('c1',$c1,$c2); } if ($d1) { $query->addRange('d1',$d1,$d2); } $query->setMultiSort($sorts); $rs = $query->setLimit($perPage,$start)->search(); $count = $xs->search->getLastCount(); 这时$count不准确,我看过论坛...
我实现了, $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...
查询业务类似于 (filed1:1 or filed1:2 or filed1:3)and (filed2:1 or filed2:2 or filed2:3) and (filed3:1 or filed3:2 or filed3:3) 使用setQuery 出现异常 DATA/NAME too long 最后使用addQueryString拼装语句的方式 但是如上所述的逻辑根本无法达到括号中...
查看了所有的帖子后,发现有点其他收货。就是利用 多文档联查 setDb() 方法 可是,会报错哦。 $search = new XS('goods_a'); $key = 'ipad'; // $index = $search->index; // $index->setDb('goods_b'); $search->search->setDb('goods_b'); $docs = $search->search->...
$search->setCharset('gbk'); 无效,输出来的还是uft-8;求助我错在那里? require '/usr/local/xunsearch/sdk/php/lib/XS.php'; $xs = new XS('allsource'); // 建立 XS 对象,项目名称为:demo $search = $xs->search; // 获取 搜索对象 $query = '部分'; // 这里的搜...
[XSException] ../../../usr/local/xunsearch/sdk/php/lib/XS.php(1552): Unexpected respond in search {CMD:129, ARG:514} 代码如下 $xs = new XS('discuz'); $tokenizer = new XSTokenizerScws; $subject = $tokenizer->getTops($forumattr['subject'], 20, 'n,ns'); $stack = array(); foreach($subject as $wor...
setScwsMulti() 方法 (自版本 v1.4.7 起可用) public XSSearch setScwsMulti(int $level) $level int 要设置的分词复合等级 {return} XSSearch 返回自身对象以支持串接操作 源码: sdk/php/lib/XSSearch.class.php#L444 (显示) public function setScwsMult...
字段配置:"use_year"为1-70的整型 [code] [use_year] type = string [/code] 搜索代码: [code] $xs = new XS('data.ini'); $search = $xs->getSearch(); $query = $fields['query']; $from = $fields['from']; $to = $fields['to']; $search->setQuery($query); $search->addRange('use_year'...