... exdata from file'); } // try to check allowed (BUG: check the first cmd only): // XS_CMD_IMPORT_HEADER, XS_CMD_INDEX_REQUEST, XS_CMD_INDEX_REMOVE, XS_CMD_INDEX_EXDATA $first = ord(substr($data, 0, 1)); if ($first != XS_CMD_IMPORT_HEADER && $first != XS_CMD_INDEX_REQUEST &&...
...ction addDb($name){ $name = strval($name); $this->execCommand(array('cmd' => XS_CMD_SEARCH_ADD_DB, 'buf' => $name)); $this->_curDbs[] = $name; return $this;} 添加搜索的数据库名, 支持多库同时搜索 参见 setDb addQueryString() 方法 public string addQue...
arg1 属性 public int $arg1; 参数1 取值范围 0~255, 具体含义根据不同的 CMD 而变化
arg2 属性 public int $arg2; 参数2 取值范围 0~255, 常用于存储 value no, 具体参照不同 CMD 而确定
...$page = $limit > 0 ? pack('II', intval($offset), intval($limit)) : ''; $cmd = array('cmd' => XS_CMD_SEARCH_GET_SYNONYMS, 'buf1' => $page); $cmd['arg1'] = $stemmed == true ? 1 : 0; $res = $this->execCommand($cmd, XS_CMD_OK_RESULT_SYNONYMS); $ret = array(); if (!empty($res->buf)) { ...
...dict'] = array(); } $this->_setting['add_dict'][] = new XSCommand(XS_CMD_SEARCH_SCWS_SET, XS_CMD_SCWS_ADD_DICT, $mode, $fpath); return $this;} 添加分词词典, 支持 TXT/XDB 格式 getResult() 方法 public array getResult(string $text) $text string 待分词的文...
...ib/XSServer.class.php#L264 (显示) public function setTimeout($sec){ $cmd = array('cmd' => XS_CMD_TIMEOUT, 'arg' => $sec); $this->execCommand($cmd, XS_CMD_OK_TIMEOUT_SET);} 设置服务端超时秒数
...n('Missing value of primary key (FIELD:' . $fid . ')'); } // request cmd $cmd = new XSCommand(XS_CMD_INDEX_REQUEST, XS_CMD_INDEX_REQUEST_ADD); if ($add !== true) { $cmd->arg1 = XS_CMD_INDEX_REQUEST_UPDATE; $cmd->arg2 = $fid->vno; $cmd->buf = $key; } $cmds = arr...
...strval($term); if (strlen($term) === 0) { return false; } $cmd = array('cmd' => XS_CMD_SEARCH_GET_SYNONYMS, 'arg1' => 2, 'buf' => $term); $res = $this->execCommand($cmd, XS_CMD_OK_RESULT_SYNONYMS); $ret = $res->buf === '' ? array() : explode("\n", $res->buf); return $ret;} ...
...391 (显示) public function beginRebuild(){ $this->execCommand(array('cmd' => XS_CMD_INDEX_REBUILD, 'arg1' => 0), XS_CMD_OK_DB_REBUILD); $this->_rebuild = true; return $this;} 开始重建索引 此后所有的索引更新指令将写到临时库, 而不是当前搜索库, 重建完...