...内容部分', 'chrono' => time() ); // 创建文档对象 $doc = new XSDocument; $doc->setFields($data); // 更新到索引数据库中 $index->update($doc); ~~~ $Id$
... 'time' => time() ); $document = new XSDocument; $document->setFields($array); $index->update($document); } $index->closeBuffer(); } $index->endRebuild(); [/php] 实际数据为61084,但是写入到index的数...
...rticle做分面搜索[/quote] 可以有两种实现方式: 1、使用XSDocument::addTerm 2、弄一个字段存放以|号分隔的多个article_category.id,把这个字段tokenizer 设为 split(|) [size=large][color=#FF0000]请问: 如果我删除了一个article_category,对于上...
...lib/XSTokenizer.class.php#L116 (显示) public function getTokens($value, XSDocument $doc = null){ $terms = array(); for ($i = 0; $i < strlen($value); $i += $this->arg) { $terms[] = substr($value, $i, $this->arg); } return $terms;}
...长,省略了 // 创建文档对象 $doc = new XSDocument; $doc->setFields($data); if ($isnewdoc) { // 添加到索引数据库中 $index->add($doc); ...
...lib/XSTokenizer.class.php#L147 (显示) public function getTokens($value, XSDocument $doc = null){ $terms = array(); $i = $this->arg; while (true) { $terms[] = substr($value, 0, $i); if ($i >= strlen($value)) { break; } $i += $this->arg; } retur...
...增加链接sql serve来链接数据库,并执行查询, 然后通过XSDocument的扩展来实现索引的添加!
... !== '') $this->length = $arg; } public function getTokens($value, XSDocument $doc=null){ $charset = is_object($doc) ? $doc->getCharset() : 'UTF-8'; $ret = array(); //如果词的总长度小于给定的长度,则直接返回该词 $strlen = mb_strlen($value,$charset); if($s...
... 'time' => time() ); $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->getC...
...$this->search($type . ':1'); foreach ($result as $doc) /* @var $doc XSDocument */ { $body = $doc->body; $ret[$body] = $doc->f($type); } $this->restoreDb(); } catch (XSException $e) { if ($e->getCode() != XS_CMD_ERR_XAPIAN) { throw $e; ...