$doc = new XSDocument; $doc->setFields($v); 改为 $doc = new XSDocument($v);
...s_name' => 'hello my goodsname', 'goods_sn' => 'RX8899-114' ); $doc = new XSDocument; $doc->setFields($data); $xs->index->add($doc); 3. 查询 3.1 $docs = $xs->search->search('RX8899-114'); ===> 无结果 3.2 $docs = $xs->search->search('RX8899'); ===> 有结果 3.3 ...
require_once 'xunsearch/lib/XS.php'; $xs = new XS('demo'); var_dump($xs); //到这里是正常的 $doc = new MyDocument; // Class 'MyDocument' not found 肯定没有这个类啊 我该怎么操作呢
... $xs = new XS('test'); $skey = $_GET["skey"]; $search = $xs->search; $docs = $search->setQuery($skey."type:1")->search(); print_r($docs); 已经 [type] type = string index = self 了 但是搜索不到什么 改成 $docs = $search->setQuery($skey)->search(); 就可以 type这个...
...$index->beginRebuild(); foreach ($data as $k => $v) { $doc = new XSDocument; $doc->setFields($v); $index->update($doc); } $index->endRebuild(); 问题 1:命令行下平滑重建能不能输出执行时间 2:A和B方法重建原...
...h->count(); 6、设置分页$search->setLimit(xxx,xxx); 7、取得结果$docs = $search->search(); 这样的一般过程吧,但第5步出来的数量貌似不准确啊 然后改成这样 1、实例化得到$xs = new Xs('xxx); 2、得到XSSearch实例,$search = $xs->search; 3、$search...
...imit(1, 1); // 设置返回结果最多为 5 条,并跳过前 10 条 $docs = $search->search(); // 执行搜索,将搜索结果文档保存在 $docs 数组中 $count = $search->count(); // 获取搜索结果的匹配总数估算值 $search->setCharset('gbk'); echo ''; var_dump($docs); ...
...nsearch/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\'t use test : ' . mysql_error()); $result=mysql_query("sele...
...search->setCharset('UTF-8'); $search->setQuery('uid:' . $uid); $docs = $search->search(); $terms = $search->getExpandedQuery($tag); 然后对 $docs 和 terms 取交集就可以了, 只不过执行了两次查询,又掉消耗效率。
... $thread['tid'] = $tid; $doc = new XSDocument; $doc->setFields($thread); $index->add($doc); } echo '200'; ...