... [times:次数,attr:词性,word:词] 源码: sdk/php/lib/XSTokenizer.class.php#L361 (显示) public function getTops($text, $limit = 10, $xattr = ''){ $words = array(); $text = $this->applySetting($text); $cmd = new XSCommand(XS_CMD_SEARCH_SCWS_GET, XS_CMD_SCWS_GET_TOPS, $limit, $text,...
...为键, 同义词条组成的数组为值 源码: sdk/php/lib/XSSearch.class.php#L164 (显示) public function getAllSynonyms($limit = 0, $offset = 0, $stemmed = false){ $page = $limit > 0 ? pack('II', intval($offset), intval($limit)) : ''; $cmd = array('cmd' => XS_CMD_SEARCH_GET_SYNONYMS...
... array 返回搜索词组成的数组 源码: sdk/php/lib/XSSearch.class.php#L795 (显示) public function getCorrectedQuery($query = null){ $ret = array(); try { if ($query === null) { if ($this->_count > 0 && $this->_count > ceil($this->getDbTotal() * 0.001)) { ...
... 返回对象本身以支持串接操作 源码: sdk/php/lib/XSSearch.class.php#L968 (显示) public function addQueryTerm($field, $term, $addOp = XS_CMD_QUERY_OP_AND, $scale = 1){ $term = strtolower($term); $term = XS::convert($term, 'UTF-8', $this->_charset); $bscale = ($scale > 0 &...
...turn} string 修正后的搜索语句 源码: sdk/php/lib/XSSearch.class.php#L949 (显示) public function addQueryString($query, $addOp = XS_CMD_QUERY_OP_AND, $scale = 1){ $query = $this->preQueryString($query); $bscale = ($scale > 0 && $scale != 1) ? pack('n', intval($scale * 100)) ...
... 返回对象本身以支持串接操作 源码: sdk/php/lib/XSSearch.class.php#L401 (显示) public function setFacets($field, $exact = false){ $buf = ''; if (!is_array($field)) { $field = array($field); } foreach ($field as $name) { $ff = $this->xs->getField($name);...
...页编码是utf8 function get_tags_arr($title){ require 'pscws4/pscws4.class.php'; $pscws = new PSCWS4(); $pscws->set_dict('scws/dict.utf8.xdb'); $pscws->set_rule('scws/rules.utf8.ini'); $pscws->set_ignore(true); $pscws->send_text($title); $words = $pscws->get_tops(10); $tags = array(); ...
...集 {return} mixed 转换后的数据 源码: sdk/php/lib/XS.class.php#L550 (显示) public static function convert($data, $to, $from){ // need not convert if ($to == $from) { return $data; } // array traverse if (is_array($data)) { foreach ($data as $key =>...
...ext = "a vnii a"; function get_tags_arr($title){ require 'pscws4/pscws4.class.php'; $cws = new PSCWS4('utf8'); $cws -> set_charset('utf-8'); $cws->set_dict('dict.utf8.xdb'); $cws->set_rule('pscws4/etc/rules.utf8.ini'); $cws->send_text($title); $words = $cws->get_tops(10); $cws->clo...
...象,请按以下方法修改一下 $prefix/sdk/php/util/XSDataSource.class.php 详见补丁文件: [url]https://github.com/hightman/xunsearch/commit/eddb1b5f4d7a7f8fb8f82f3675e97640a9d4ed83[/url]