...n $value; } // initlize the highlight replacements if (!is_array($this->_highlight)) { $this->initHighlight(); } // process replace if (isset($this->_highlight['pattern'])) { $value = preg_replace($this->_highlight['pattern'], $this->_highlight['replace'], $value); ...
...) public function getCustomTokenizer(){ if (isset(self::$_tokenizers[$this->tokenizer])) { return self::$_tokenizers[$this->tokenizer]; } else { if (($pos1 = strpos($this->tokenizer, '(')) !== false && ($pos2 = strrpos($this->tokenizer, ')', $pos1 + 1))) { ...
...p/lib/XS.class.php#L346 (显示) public function restoreScheme(){ if ($this->_scheme !== $this->_bindScheme) { $this->_scheme = $this->_bindScheme; if ($this->_search !== null) { $this->_search->markResetScheme(true); } }} 还原字段方案为项目绑定...
...L492 (显示) public function addDb($name){ $name = strval($name); $this->execCommand(array('cmd' => XS_CMD_SEARCH_ADD_DB, 'buf' => $name)); $this->_curDbs[] = $name; return $this;} 添加搜索的数据库名, 支持多库同时搜索 参见 setDb addQueryString() 方法 ...
...cmd as $key => $value) { if ($key === 'arg' || property_exists($this, $key)) { $this->$key = $value; } } } else { $this->cmd = $cmd; $this->arg1 = $arg1; $this->arg2 = $arg2; $this->buf = $buf; $this->buf1 = $buf1; ...
... if (is_file($file2)) { $file = $file2; } } $this->loadIniFile($file); self::$_lastXS = $this;} 构造函数 特别说明一个小技巧, 参数 $file 可以直接是配置文件的内容, 还可以是仅仅是文件名, 如果只是文件名会自动查找 XS_LI...
...p/lib/XS.class.php#L467 (显示) public function getScwsServer(){ if ($this->_scws === null) { $conn = isset($this->_config['server.search']) ? $this->_config['server.search'] : 8384; $this->_scws = new XSServer($conn, $this); } return $this->_scws;} 创建 scws 分词连...
...urce.class.php#L30 (显示) public function __construct($type, $arg){ $this->type = $type; $this->arg = $arg; $this->inCli = php_sapi_name() === 'cli'; $this->init();} 构造函数 deinit() 方法 protected void deinit() 源码: sdk/php/util/XSDataSource.class.php#L104...
...$field, $term, $weight = 1){ $field = strval($field); if (!is_array($this->_terms)) { $this->_terms = array(); } if (!isset($this->_terms[$field])) { $this->_terms[$field] = array($term => $weight); } elseif (!isset($this->_terms[$field][$term])) { $this->_terms[$...
...disable query with field filter if ($query === null) { $query = $this->cleanFieldQuery($this->_query); } if (empty($query) || strpos($query, ':') !== false) { return $ret; } // Search the log database $op = $this->_defaultOp; $this->xs->setScheme(XSFieldScheme::log...