...num)->setSort('post_time',true)->setQuery($q); print_r($search->query); $docs = $search->search(); print_r结果:Xapian::Query(波:(pos=1)) $docs 中的user_id 并没有限制在 1,20000....
...关键字设为空了 $xs = new XS($project); $search = $xs->search; $docs = $search->setQuery()->search(); 会提示setQuery 缺少参数,看了源码,原来写法是setQuery($query) 手工改成 $docs = $search->setQuery(NULL)->search(); 结果中所有type = numeric 的字段...
...分词结果 getTokens() 方法 public void getTokens($value, $doc=NULL) $value $doc 源码: sdk/php/lib/XSTokenizer.class.php#L220 (显示) public function getTokens($value, XSDocument $doc = null){ $tokens = array(); $this->setIgnore(true); // save chars...
... XSSearch setDb() 设置要搜索的数据库名 XSSearch setDocOrder() 设置结果按索引入库先后排序 XSSearch setFacets() 设置分面搜索记数 XSSearch setFuzzy() 开启模糊搜索 XSSearch setLimit() 设置搜索结果的数量和偏移 XSSe...
...arch.php中的代码: $xs = new XS(`demo`); $search = $xs->search; $doc = $search->search("项目"); print_r($doc) 但是运行的时候报错,请问有可能是什么原因呢? Fatal error: Uncaught [XSErrorException] /search.php(5): Undefined index: key(8) thrown in /home/boyce/xun...
... } }} getTokens() 方法 public void getTokens($value, $doc=NULL) $value $doc 源码: sdk/php/lib/XSTokenizer.class.php#L116 (显示) public function getTokens($value, XSDocument $doc = null){ $terms = array(); for ($i = 0; $i < strlen($value); $i +=...
... } }} getTokens() 方法 public void getTokens($value, $doc=NULL) $value $doc 源码: sdk/php/lib/XSTokenizer.class.php#L147 (显示) public function getTokens($value, XSDocument $doc = null){ $terms = array(); $i = $this->arg; while (true) { ...
.../lib/XS.php'; $xs = new XS('demo'); $search = $xs->search; $docs = $search->search('cat_ids:108 a'); ---------------------------------------------------------- project.name = demo project.default_charset = utf-8 server.index = 8383 server.search = 8384 [goods_id] type = id ...
.../lib/XS.php'; $xs = new XS('demo'); $search = $xs->search; $docs = $search->search('cat_ids:108 a'); ---------------------------------------------------------- project.name = demo project.default_charset = utf-8 server.index = 8383 server.search = 8384 [goods_id] type = id ...
...$search->setQuery($query); $search->addRange('use_year', $from , $to); $docs = $search->search(); print_r($search->count()); [/code] 不管怎么设置$from跟$to,显示的总数都基本是一样的,实际总数只有打印的总的一半甚至更少,误差很大。 尝试修改过...