...er = full 2. 导入相关数据 require_once '/usr/local/xunsearch/sdk/php/lib/XS.php'; $xs = new XS('goods'); $data = array( 'goods_id' => 112, 'goods_name' => 'hello my goodsname', 'goods_sn' => 'RX8899-114' ); $doc = new XSDocument; $doc->setFields($data); $xs...
...ield 参数为 string 时作为新建字段的配置内容 源码: sdk/php/lib/XSFieldScheme.class.php#L139 (显示) public function addField($field, $config = null){ if (!$field instanceof XSFieldMeta) { $field = new XSFieldMeta($field, $config); } if (isset($this->_fields[$fie...
...未指定 - 开头的选项统一放入 '-' 的子数组 源码: sdk/php/util/XSUtil.class.php#L108 (显示) public static function parseOpt($valued = array()){ $result = array('-' => array()); $params = isset($_SERVER['argv']) ? $_SERVER['argv'] : array(); for ($i = 0; $i < count($par...
...turn} XSSearch 返回对象本身以支持串接操作 源码: sdk/php/lib/XSSearch.class.php#L289 (显示) public function setSort($field, $asc = false, $relevance_first = false){ if (is_array($field)) { return $this->setMultiSort($field, $asc, $relevance_first); } if ($fie...
...索、搜索建议和纠错等内容。 [url]http://www.xunsearch.com/doc/php/guide/util.logger[/url] 2. 小修改大提升,支持自定义 SCWS 分词词典,文本格式。但旧有索引必须重建,新增的词汇才能生效。 [url]http://www.xunsearch.com/doc/php/guide/index.dict[/u...
...z` 的分词器,则您要编写的代码 文件为 `XSTokenizerXyz.class.php`,请将文件统一放入 `$prefix/sdk/php/lib` 目录。 通常来讲,您只需要实现 [XSTokenizer::getTokens] 即可。该函数接受 2个参数,分别为要分词的值以及 当前的文档对象(可选);...
... 20 {return} array 返回搜索词组成的数组 源码: sdk/php/lib/XSSearch.class.php#L755 (显示) public function getExpandedQuery($query, $limit = 10){ $ret = array(); $limit = max(1, min(20, intval($limit))); try { $buf = XS::convert($query, 'UTF-8', $this->_chars...
...关数据,就是搜不到。 require_once '/usr/local/xunsearch/sdk/php/lib/XS.php'; $xs = new XS('zl'); $index = $xs->index; $doc = new XSDocument; $conn=mysql_connect("localhost", "root", "111111") or die("Could not connect: " . mysql_error()); mysql_select_db('zi, $conn) or die ('Can...
getDataList() 方法 protected void getDataList() 源码: sdk/php/util/XSDataSource.class.php#L295 (显示) protected function getDataList(){ // read line (check to timeout?) $line = ''; while (true) { $buf = fgets($this->fd, 8192); if ($buf === false || strlen($bu...
...turn} XSSearch 返回对象本身以支持串接操作 源码: sdk/php/lib/XSSearch.class.php#L349 (显示) public function addRange($field, $from, $to){ if ($from === '' || $from === false) { $from = null; } if ($to === '' || $to === false) { $to = null; } if (...