...) public function getTokens($value, XSDocument $doc = null){ $terms = array(); for ($i = 0; $i < strlen($value); $i += $this->arg) { $terms[] = substr($value, $i, $this->arg); } return $terms;}
... public function open($conn){ parent::open($conn); $this->_prefix = array(); $this->_fieldSet = false; $this->_lastCount = false;} 连接搜索服务端并初始化 每次重新连接后所有的搜索语句相关设置均被还原
...那么创建吧,而且这个创建了是存到那里了呢? $data = array( 'pid' => 234, // 此字段为主键,必须指定 'subject' => '测试文档的标题', 'message' => '测试文档的内容部分', 'chrono' => time() ); // 创建文档对象 $doc = new XSDo...
http://code.google.com/p/xsplit/ bool xs_build (array $words, string $dict_file) 从$words数组建立名称为$dict_file的词典,若成功则返回true。$words数组的格式请参考示例,key为词语,value为词频。 这样生成词库,相当有方便,能否也增加一...
...) public function getTokens($value, XSDocument $doc = null){ $terms = array(); $i = $this->arg; while (true) { $terms[] = substr($value, 0, $i); if ($i >= strlen($value)) { break; } $i += $this->arg; } return $terms;}
...lass.php#L495 (显示) public function setCustomDict($content){ $cmd = array('cmd' => XS_CMD_INDEX_USER_DICT, 'arg1' => 1, 'buf' => $content); $this->execCommand($cmd, XS_CMD_OK_DICT_SAVED);} 设置自定义词典内容
...erver.class.php#L264 (显示) public function setTimeout($sec){ $cmd = array('cmd' => XS_CMD_TIMEOUT, 'arg' => $sec); $this->execCommand($cmd, XS_CMD_OK_TIMEOUT_SET);} 设置服务端超时秒数
...示) public function getTokens($value, XSDocument $doc = null){ return array();}
...dataPos = 0; $this->dataList = $this->getDataList(); if (!is_array($this->dataList) || count($this->dataList) === 0) { $this->deinit(); $this->dataList = $this->dataPos = null; return false; } } $data = $this->dataList[$this->dataPos]; $...
...示) public function getTokens($value, XSDocument $doc = null){ return array($value);}