...EARCH_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 获取
...rcent))); $weight = max(0, (intval($weight * 10) & 255)); $cmd = new XSCommand(XS_CMD_SEARCH_SET_CUTOFF, $percent, $weight); $this->execCommand($cmd); return $this;} 设置百分比/权重剔除参数 通常是在开启 setFuzzy 或使用 OR 连接搜索语句时才需要设置此项
...tField($field, true)->vno; $max = min(255, intval($num)); $cmd = new XSCommand(XS_CMD_SEARCH_SET_COLLAPSE, $max, $vno); $this->execCommand($cmd); return $this;} 设置折叠搜索结果 注意, 每当调用 setDb 或 addDb 修改当前数据库时会重置此项设置
...rval($synonym); if ($raw !== '' && $synonym !== '') { $cmd = new XSCommand(XS_CMD_INDEX_SYNONYMS, XS_CMD_INDEX_SYNONYMS_ADD, 0, $raw, $synonym); if ($this->_bufSize > 0) { $this->appendBuffer(strval($cmd)); } else { $this->execCommand($cmd, XS_CMD_OK_RQS...
...SCWS_XDICT_TXT : SCWS_XDICT_XDB; } $this->_setting['set_dict'] = new XSCommand(XS_CMD_SEARCH_SCWS_SET, XS_CMD_SCWS_SET_DICT, $mode, $fpath); unset($this->_setting['add_dict']); return $this;} 设置分词词典, 支持 TXT/XDB 格式
... $words = array(); $text = $this->applySetting($text); $cmd = new XSCommand(XS_CMD_SEARCH_SCWS_GET, XS_CMD_SCWS_GET_RESULT, 0, $text); $res = self::$_server->execCommand($cmd, XS_CMD_OK_SCWS_RESULT); while ($res->buf !== '') { $tmp = unpack('Ioff/a4attr/a*word', $res->buf); ...
... $this->_count !== null) { return $this->_count; } $cmd = new XSCommand(XS_CMD_SEARCH_GET_TOTAL, 0, $this->_defaultOp, $query); $res = $this->execCommand($cmd, XS_CMD_OK_SEARCH_TOTAL); $ret = unpack('Icount', $res->buf); if ($query === '') { $this->_count = $ret['count']...
... === null ? '' : strval($synonym); if ($raw !== '') { $cmd = new XSCommand(XS_CMD_INDEX_SYNONYMS, XS_CMD_INDEX_SYNONYMS_DEL, 0, $raw, $synonym); if ($this->_bufSize > 0) { $this->appendBuffer(strval($cmd)); } else { $this->execCommand($cmd, XS_CMD_OK_RQS...
...setting['add_dict'] = array(); } $this->_setting['add_dict'][] = new XSCommand(XS_CMD_SEARCH_SCWS_SET, XS_CMD_SCWS_ADD_DICT, $mode, $fpath); return $this;} 添加分词词典, 支持 TXT/XDB 格式
...rms !== 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($tm...