一般过程: 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、取...
...列出来的关键词(分词之后)全部匹配,如果您通过 [XSSearch::setFuzzy] 开启了模糊匹配,那么相当于采用 `OR` 规则,只要其中一个关键词匹配即可。 刚刚说的这种搜索的是索引数据库的“混合区”,即类型为 `body` 的字段以及索...
...两种做法,至于喜欢用哪种您自己决定。 * 调用方法 [XSSearch::getDbTotal] * 读取魔术属性 [XSSearch::dbTotal],内部也是调用上述方法 ~~~ [php] $total = $search->dbTotal; $total = $search->getDbTotal(); ~~~ 最近一次搜索的匹配数 ------------------ 通...
...怀疑是这么多字段索引造成的压力 [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] 不知这样...
...both tokenizer = split([/[\s,\/]+/]) 搜索语句的写法为: $search->setLimit(10); //设置返回结果最多为 5 条,并跳过前 10 条 $docs = $search->search("tags:公务员考试 AND tags:论文 AND tags:杂志 AND tags:报纸 AND tags:教材"); $count = $search->getLastCount...
$search->setCharset('gbk'); 无效,输出来的还是uft-8;求助我错在那里? require '/usr/local/xunsearch/sdk/php/lib/XS.php'; $xs = new XS('allsource'); // 建立 XS 对象,项目名称为:demo $search = $xs->search; // 获取 搜索对象 $query = '部分'; // 这里的搜...
tokenizer = split([/[\s,\/]+/]) 写法不正确,去掉 [] 数据量一直有说明是估算值
$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...
类似k-v的方式 既然主键唯一,能不能直接get出来 用search虽然也可以出来,但是不确定效率是否ok $search = $xs->search; $query =""; $search->setQuery($query); $search->addRange('pid',52382920,52382920); //$search->setSort('dateline'); $docs = $search->sea...
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 了 但是搜索不到什么 改成...