|
||||||||||||
|
|
| 有关jive论坛搜索中文化的支持详解! |
| 时间:22/04/2007 作者:网络 来源:网络 |
| 小提示→点这里把文章加入您的收藏夹,方便下次查看 |
| 设置文章字体大小:[大 中 小] |
|
Jive的搜索借用了apche提供的lucene搜索引擎。lucene是一个纯Java的高性能的全文搜索引擎,你可以到apache的网站找到lucene的更多信息: 但在Jive使用的lucene包中,并不支持中文搜索,本站的系统也是构建在Jive之上进行扩展, 2:修改您的DbSearchManager.java import org.apache.lucene.analysis.cn.*; 在DbSearchManager.java中找到如下代码: /** * The analyzer governs how words are tokenized. The standard anaylyzer * does a decent job in most cases, but could be replaced under certain * circumstances. We make the analyzer protected so that the DbQuery class * can also reference it (indexing and searching should use the same * analyzer). */ protected static Analyzer analyzer = new StandardAnalyzer(); 替换为: protected static Analyzer analyzer = new ChineseAnalyzer();
要使用中文搜索,您的搜索的jsp的页面也需要使用GB2312的编码方式: java.net.URLEncoder.encode(queryText,"GB2312"); 5:最后总结: |
|
上一篇:关于软件的思考(一)---面向对象、模式、框架
下一篇:Java代码编写的30条建议 |
| 【返回】 【顶部】 【关闭】 |
| Copyright © 2005-2010 www.594k.com All Rights Reserved. |
| 版权所有:JAVA学习网
备案序号:皖ICP备06004238号 |