E
elan
Unregistered / Unconfirmed
GUEST, unregistred user!
孙老师,我再问最后一个问题
当我用jsp查找中文关键词的时候,无论我输入什么中文,query.toString() 返回的都是乱码
如:
...
String strName = request.getParameter("query");
Searcher searcher = new IndexSearcher("index");
Analyzer analyzer = new ChineseAnalyzer();
// 这行是对的
out.println("Searching for: " + strName + "<br>/n");
Query query = QueryParser.parse(strName, "contents", analyzer);
//这行输出乱码
out.println("Searching for: " + query.toString("contents") + "<br>/n");
.....
多谢了!
当我用jsp查找中文关键词的时候,无论我输入什么中文,query.toString() 返回的都是乱码
如:
...
String strName = request.getParameter("query");
Searcher searcher = new IndexSearcher("index");
Analyzer analyzer = new ChineseAnalyzer();
// 这行是对的
out.println("Searching for: " + strName + "<br>/n");
Query query = QueryParser.parse(strName, "contents", analyzer);
//这行输出乱码
out.println("Searching for: " + query.toString("contents") + "<br>/n");
.....
多谢了!