...论坛文章搜索为例,每篇文章均属于不同版块(字段为 fid)、不同的发表年份 (字段为 year),我们需要在搜索结果中按年份、版块显示匹配的文章数。 那么在构建搜索语句时使用 [XSSearch::setFacets] 方法来指定需要分面的字段...
...= 192.168.0.250:8383 server.search = 192.168.0.250:8384 [tid] type = id [fid] index = self tokenizer = full [author] [authorid] index = self tokenizer = full [postdate] tokenizer = full [subject] type = title [content] type = body #导入 php util/Indexer.php --rebuild --source=mysql://数...
...E TABLE `cdb_posts` ( `pid` int(10) unsigned NOT NULL auto_increment, `fid` smallint(6) unsigned NOT NULL default '0', `tid` mediumint(8) unsigned NOT NULL default '0', `first` tinyint(1) NOT NULL default '0', `author` varchar(15) NOT NULL default '', `authorid` mediumint(8) unsigned NOT...
...false) { return $this; } // check primary key of document $fid = $this->xs->getFieldId(); $key = $doc->f($fid); if ($key === null || $key === '') { throw new XSException('Missing value of primary key (FIELD:' . $fid . ')'); } // request cmd $cmd = new XSCommand(...
...样,索引的相关字段也可能不同。 比如说主题里有id,fid,author,authorid,time,title,body,isdel,ishidden,isreply等等,这些都放到索引里 而回帖表里有tid,author,authorid,time,body,isdel,isUseTools,ishidden,isAnonymous等字段需要放到索引里 而我搜索...
...] index = both [authorid] [tid] index = self tokenizer = full [fid] index = self tokenizer = full [flag] [/code] mysql数据库,sample.sql [code]-- -- Table structure for table `sample` -- CREATE TABLE IF NOT EXISTS `sample` ( `id` int(12) unsigned NOT NULL AUTO_INCRE...
... index = self [tid] type = string index = self tokenizer = full [fid] type = string index = self tokenizer = full [title] index = both type = title [content] index = mixed type=body [url] index = self type = string [sort] index = self type = string [frist] index ...
...t = GBK server.index = 8383 server.search = 8384 [pid] type = id [fid] index = self tokenizer = full [tid] [first] index = self tokenizer = full [author] index = both [authorid] [subject] type = title [message] type = body [dateline] type = numeric
...配置示范文件,包含 12 个字段。其中可以看到 `tid` 和 `fid` 虽然从内容上讲它们都是数字型,但没有排序需求所以仍应为 `string` 类型,而 `dateline` 由于有排序需求,所以必须指定为 `numeric` 类型。 ~~~ project.name = sample proj...
...false) { return $this; } // check primary key of document $fid = $this->xs->getFieldId(); $key = $doc->f($fid); if ($key === null || $key === '') { throw new XSException('Missing value of primary key (FIELD:' . $fid . ')'); } // request cmd $cmd = new XSCommand(...