我现在取得$words = $search->getHotQuery(); // 获取前 6 个总热门搜索词 里面发现有 几个是我不想要的,我就想删除掉 http://www.xunsearch.com/doc/php/guide/util.logger 看了这个文档,发现比较好操作 # 删除 demo 项目中 搜索日志词 word util/Lo...
...你对API使用不正确, scws_get_result 应该循环调用 while ($words = scws_get_result($sh)) { foreach ($words as $word) { print_r($word); } } 此外, 繁体词库很不完善, 缺词太多而且有一些词也不正确 [/quote] 非常謝謝版主的指導,我...
... cnt = 0; \ for (cnt = 0; (word = strchr(xattr, ',')); cnt++) { \ ! strncpy(at[cnt], xattr, 2); \ xattr = word + 1; \ } \ strn...
...; // $so->set_duality(0); $so->set_ignore(1); $so->set_multi(0); $words = $_GET['words']; //分词 $so->send_text($words); echo($words); //打印搜索的关键字 var_dump($so->get_result()); $so->close(); 异常下返回的结果 bool(true) bool(true) 笔记本电脑 bool(...
...问题的。 [php] Array ( [0] => Array ( [word] => 我 [off] => 0 [len] => 3 [idf] => 0 [attr] => r ) [1] => Array ( [word] => 是 [off] => 3 [len] => ...
...代码吧 // hightman.070902: multi segment // step1: split to short words if ((j-i) > 1) { int n, k, m = i; int fir = -1; if (s->mode & SCWS_MULTI_SHORT) { while (m < j) { k = m; fir = -1; // hightman.111223: multi short enhanced for...
...了一下源代码,的确有一个地方没有free。在 scws.c/scws_has_word()函数中: __PARSE_XATTR__; // 这个宏里有一个内存申请:at = (word_attr *) malloc(cnt); 申请的内存没有释放。应该在scws_has_word()函数最后添加一句:free(at); 即可。 另外,...
...$forumattr['subject'], 20, 'n,ns'); $stack = array(); foreach($subject as $word) { array_push($stack, $word['word']); } $subject = implode(' OR ', $stack); $keyword = $metakeywords = implode(' ', $stack); $search = $xs->search; $search->setCharset('GBK')->setLimit($ppp, $start_limit)->addWeight('su...
...t+1])) break; *************** *** 677,683 **** wmap[i][i] = (word_t) pmalloc_z(p, sizeof(word_st)); wmap[i][i]->tf = 0.5; wmap[i][i]->flag |= SCWS_ZFLAG_ENGLISH; ! strcpy(wmap[i][i]->attr, attr_un); } else { --- 684,690 ---- wmap[i][i] = (word_t) pmalloc_z...
... break; *************** *** 677,683 **** wmap[i][i] = (word_t) pmalloc_z(p, sizeof(word_st)); wmap[i][i]->tf = 0.5; wmap[i][i]->flag |= SCWS_ZFLAG_ENGLISH; ! strcpy(wmap[i][i]->attr, attr_un); } else { --- 684,...