Groups
Groups
Sign in
Groups
Groups
Do Best Developer
Conversations
About
Send feedback
Help
你好,我是一个新手,刚刚用到lucene,为什么你下面的分词在jsp下不好用?要进行什么转换吗?期待回复
0 views
Skip to first unread message
lnz...@gmail.com
unread,
Sep 9, 2007, 2:32:47 AM
9/9/07
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Do Best Developer
public static void main(String[] args) {
Analyzer analyzer = new ChineseAnalyzer();
QueryParser queryParser = new QueryParser( "field", analyzer);
queryParser.setDefaultOperator(QueryParser.AND_OPERATOR);
Query query = null;
try {
String test = "冗长的代码常常是复杂性的标志,会导致代码难以测试和维护。";
query = queryParser.parse(test);
System.out.println(query.toString("field"));
} catch (ParseException e) {
e.printStackTrace();
}
}
Reply all
Reply to author
Forward
0 new messages