...6 (显示) 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;}
...7 (显示) 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; } return $terms;}
... 参见 openBuffer del() 方法 public XSIndex del(mixed $term, string $field=NULL) $term mixed 单个主键或指定字段的索引词, 或多个组成的数组, 编码与 xs 默认字符集一致 $field string 索引词所属的字段名称, 默认不指定则为主...
...题 public function getTokens($value, XSDocument $doc = null) { $terms = array(); for ($i = 0; $i < mb_strlen($value,"utf-8"); $i += $this->arg) { $terms[] = mb_substr($value, $i, $this->arg,"utf-8"); } return $terms; } hightman可以改成这个,那中文一元切分...
...nking] => 0 [255] => ) [_terms:XSDocument:private] => [_texts:XSDocument:private] => [_charset:XSDocument:private] => UTF-8 [_meta:XSDocument:private] => Array ( [docid] => 950...
..._content AS post_content_full,u.user_login AS author,t.name AS category,tt.term_taxonomy_id AS category_id FROM wp_posts AS p LEFT JOIN wp_users AS u ON p.post_author=u.ID LEFT JOIN wp_term_relationships AS tr ON p.ID=tr.object_id LEFT JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id=tt.term_taxonomy...
...6 (显示) 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;}
...7 (显示) 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; } return $terms;}
...); $docs = $search->search(); $terms = $search->getExpandedQuery($tag); 然后对 $docs 和 terms 取交集就可以了, 只不过执行了两次查询,又掉消耗效率。