请问: $index->add($doc)能调试的不,我在自己的代码加上这个,但search的时候搜索不到新add的数据 文档上写的返回的index对象,不知道能不能调试啊[hr] 按大大指示,加上了 $index->flush(); 还是没效果,这个add方法有返回提示吗,API上...
不对呢,仔细看一下这里,http://www.xunsearch.com/doc/php/guide/index.rebuild // 这里是开始,所有的索引操作都放在里面,update操作会先执行删除操作,然后执行add操作,update也可以的 $index->beginRebuild(); $data = array(); $doc = new XSDocument; $doc->...
...作方式来解决一些循环的数据。 以下是官方提供的: $index->openBuffer(); // 开启缓冲区,默认 4MB,如 $index->openBuffer(8) 则表示 8MB // 在此进行批量的文档添加、修改、删除操作 ... $index->add($doc); ... $index->del($doc); ... $index->up...
1. 相关ini配置: [goods_id] type = id index = self [goods_name] type = title index = both [goods_sn] index = both tokenizer = full 2. 导入相关数据 require_once '/usr/local/xunsearch/sdk/php/lib/XS.php'; $xs = new XS('goods'); $data = array( 'goods_id' => 112, ...
哦这样啊 谢谢了,祝愿xs 越来越好,顶了。[hr] 这样子对否? $doc = new XSDocument; $doc->setFields($data); $index->beginRebuild(); $index->add($doc);//如果写update 行不行? $index->endRebuild();
index的update现在是删除现有的整个document,然后替换新传入的doc,有没有办法只更新doc下面的某一个field的方式呢?
util/Indexer.php --rebuild --source, rebuild 是配合--source来使用的,详看[url=http://www.xunsearch.com/doc/php/guide/util.indexer#ch5]说明[/url]。具体用法为: # 导入 MySQL 数据库的 dbname.tbl_post 表到 demo 项目中,并且平滑重建 util/Indexer.php --rebuild --sour...
...件如下 project.name = entry project.default_charset = UTF-8 server.index = 10.1.20.51:8383 server.search = 10.1.20.51:8384 [tblog_entry_id] type = id [content] type = string index = both [user_id] type = numeric index = self tokenizer = full [post_time] type = numeric in...
...comment as c on g.gid = c.gid where ..... group by g.gid 然后,用$index->add($doc), 一条条加入 2> 更新索引时,我又重新跑一次sql, select * from goods as g left join order as o on g.gid = o.gid left join comment as c on g.gid = c.gid where ..... group by g.gid 获...