...p?tid=349&pid=4427#pid4427这个帖子,把关键字设为空了 $xs = new XS($project); $search = $xs->search; $docs = $search->setQuery()->search(); 会提示setQuery 缺少参数,看了源码,原来写法是setQuery($query) 手工改成 $docs = $search->setQuery(NULL)->search(); ...
...->getField($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 修改当前数据库时会重置此项设置
哦这样啊 谢谢了,祝愿xs 越来越好,顶了。[hr] 这样子对否? $doc = new XSDocument; $doc->setFields($data); $index->beginRebuild(); $index->add($doc);//如果写update 行不行? $index->endRebuild();
...,其中docs里 数据中文的是乱码 搜索中文 没有结果 $xs = new XS('entry'); $search = $xs->getSearch(); $search->setCharset('utf8'); 有结果中文乱码 $docs = $search->search('whitesnow'); 没有结果 $docs = $search->search('小雪'); 以上数据 content 都是存...
...SIndex.class.php#L33 (显示) public function addServer($conn){ $srv = new XSServer($conn, $this->xs); self::$_adds[] = $srv; return $srv;} 增加一个同步索引服务器
...e ? 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 格式
写个页面包含了 require_once '/data/new_shop/public/xunsearch-full/sdk/php/lib/XS.php'; 文件或者生成demo搜索页都报同一个错误; 错误:[XSErrorException] ../../../software/install/xunsearch-full/sdk/php/lib/XS.php(501): xcache_get(): XCache var cache was not initialize...
...' && $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['cou...
...s->_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 格式
...56 (显示) public function connect($param){ try { $this->obj = new SQLite3($param['path'], SQLITE3_OPEN_READONLY); } catch (Exception $e) { throw new XSException($e->getMessage()); }} 打开数据库 query() 方法 public mixed query(string $sql) $sql str...