...t($vnoes[$res->arg]) ? $vnoes[$res->arg] : $res->arg; $doc->setField($name, $res->buf); } } elseif ($res->cmd == XS_CMD_SEARCH_RESULT_MATCHED) { // matched terms if (isset($doc)) { $doc->setField('matched', explode(' ', $res->buf)...
...、取值 $value = $doc->f('name'); // 用函数方式进行取值 $doc->setField('name', 'value'); // 用函数方式进行赋值 $doc->setFields(array('name' => 'value', 'name2' => 'value2')); // 用数组进行批量赋值 // 迭代方式取所有字段值 foreach($doc as $name => $value) { ...
... ); $document = new XSDocument; $document->setFields($array); $index->update($document); } $index->closeBuffer(); } $index->endRebuild(); [/php] 实际数据为61084,但是写入到index的数据不确定 在调整每次读取...
...s $node){ $cid = $node->getId(); if($i++ == 0){ $doc->setField('cid', $cid); }else{ $doc->addTerm('cid', $cid); } // 父类别id while($node = $node->getParent()){ $doc->addTerm('cid', $node->getId()); } } 搜索 $searc...
... $doc = new XSDocument; $doc->setFields($data); if ($isnewdoc) { // 添加到索引数据库中 $index->add($doc); } else { ...
... 'chrono' => time() ); // 创建文档对象 $doc = new XSDocument; $doc->setFields($data); // 添加到索引数据库中 $index->add($doc); ~~~ $Id$
... ); $document = new XSDocument; $document->setFields($array); $index->add($document); echo (string)$wiki->getId()." is update to xunsearch Document \r\n"; $wiki_date = new MongoDate($wiki->getCreatedAt()->getTimestamp()); ...
...e', '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 $docs = $xs->search->search...
...id"]=$r['sid']; $a["content"]=$r['content']; $a["key"]=$r['key']; $doc->setFields($a); $index->update($doc); } 我是这样写的。
... $doc = new XSDocument; $doc->setFields($thread); $index->add($doc); } echo '200'; } } catch(XS...