require_once 'xunsearch/lib/XS.php'; $xs = new XS('demo'); var_dump($xs); //到这里是正常的 $doc = new MyDocument; // Class 'MyDocument' not found 肯定没有这个类啊 我该怎么操作呢
$doc = new XSDocument; $doc->setFields($v); 改为 $doc = new XSDocument($v);
...了一个XS.php软连接到/usr/local/xunsearch/sdk/php/lib/XS.php $xs = new XS('../app/torrentkittys.ini') 和 $xs = new XS('torrentkittys'); $xs = new XS('../../../../usr/local/xunsearch/sdk/php/app/torrentkittys.ini'); 均不成功 均报错 Fatal error: Uncaught [XSException] ../../../../...
...ongo(); $wiki_repo = $mongo->getRepository("Wiki"); $wiki_date = new MongoDate(0); $xs = new XS('demo'); $index = $xs->index; while (true) { $wikis = $wiki_repo->find(array("query" => array("created_at" => array('$gt' => $wiki_date)), "sort" => array("created_at" =>...
...onyms(true)就开启 但是我测试部行啊 附上代码: [php] $xs = new XS('demo'); // 建立 XS 对象,项目名称为:demo $search=$xs->search; $search->setAutoSynonyms(true); $index->addSynonym('搜索','检索'); $index->addSynonym('搜索','查找'); [/php] 然后查看是否成功 ...
...果。 require_once '/home/wlx/xunsearch/sdk/php/lib/XS.php'; $xs=new XS('westdc'); $tokenizer = new XSTokenizerScws; $text = '塔里木河下游浅层地下水变化的生态效应及生态系统健康评价研究项目的汇交数据'; $words = $tokenizer->getResult($text); print_r($wor...
...52): Unexpected respond in search {CMD:129, ARG:514} 代码如下 $xs = new XS('discuz'); $tokenizer = new XSTokenizerScws; $subject = $tokenizer->getTops($forumattr['subject'], 20, 'n,ns'); $stack = array(); foreach($subject as $word) { array_push($stack, $word['word']); } $subject = implode(' ...
...关数据 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->index->add($doc); 3....
...速度有好处 我怀疑是这么多字段索引造成的压力 [php]$xs=new XS('shi'); $search=$xs->search; $docs=$search->setQuery($keyword)->setLimit(12,($list_page-1)*12)->search(); $count=$search->getLastCount(); $time=$search->setQuery($keyword)->setSort('time')->setLimit(22)->search();[...
... AFTER INSERT ON pw_threads FOR EACH ROW insert into mq (tid, type) values(new.tid, 0); CREATE TRIGGER umq AFTER UPDATE ON pw_threads FOR EACH ROW insert into mq (tid, type) values(old.tid, 1); CREATE TRIGGER dmq AFTER DELETE ON pw_threads FOR EACH ROW insert into mq (tid, type) values(old.tid, 2)...