...FieldScheme::MIXED_VNO : $this->xs->getField($field, true)->vno; $cmd = new XSCommand(XS_CMD_QUERY_TERM, $addOp, $vno, $term, $bscale); $this->execCommand($cmd); return $this;} 增加默认搜索词汇
...ode] [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', $from , $to); $docs = $search->search()...
...MISC_SYN_SCALE; $arg2 = max(0, (intval($value * 100) & 255)); $cmd = new XSCommand(XS_CMD_SEARCH_SET_MISC, $arg1, $arg2); $this->execCommand($cmd); return $this;} 设置同义词搜索的权重比例
... $mode = intval($mode) & self::MULTI_MASK; $this->_setting['multi'] = new XSCommand(XS_CMD_SEARCH_SCWS_SET, XS_CMD_SCWS_SET_MULTI, $mode); return $this;} 设置复合分词选项
...) { $type |= XS_CMD_SORT_FLAG_ASCENDING; } $cmd = new XSCommand(XS_CMD_SEARCH_SET_SORT, $type, 0, $buf); $this->execCommand($cmd); } return $this;} 设置多字段组合排序方式 当您需要根据多个字段的值按不同的方式综合排序时, 请...
...的 [user_id] type = numeric index = none tokenizer = full $xs = new XS('entry'); $search = $xs->getSearch(); $search->setCharset('utf8'); $search->addRange('user_id',1,20000)->setLimit($page_num,($page-1)*$page_num)->setSort('post_time',true)->setQuery($q); print_r($search->query); ...
...MD_SEARCH_MISC_MATCHED_TERM; $arg2 = $value === true ? 1 : 0; $cmd = new XSCommand(XS_CMD_SEARCH_SET_MISC, $arg1, $arg2); $this->execCommand($cmd); return $this;} 设置在搜索结果文档中返回匹配词表 请在 search 前调用本方法, 然后使用 XSDocument::matched 获...
... demo 项目在本地可以运行 search.php中的代码: $xs = new XS(`demo`); $search = $xs->search; $doc = $search->search("项目"); print_r($doc) 但是运行的时候报错,请问有可能是什么原因呢? Fatal error: Uncaught [XSErrorException] /search.php(5): Undefined...
...>_terms !== null) { $ret = $this->_terms; } else { $cmd = new XSCommand(XS_CMD_QUERY_GET_TERMS, 0, $this->_defaultOp, $query); $res = $this->execCommand($cmd, XS_CMD_OK_QUERY_TERMS); $ret = array(); $tmps = explode(' ', $res->buf); for ($i = 0; $i < count...
... $query = $query === null ? '' : $this->preQueryString($query); $cmd = new XSCommand(XS_CMD_QUERY_GET_STRING, 0, $this->_defaultOp, $query); $res = $this->execCommand($cmd, XS_CMD_OK_QUERY_STRING); if (strpos($res->buf, 'VALUE_RANGE') !== false) { $regex = '/(VALUE_RANGE) (\d+) (\S+...