有用过lucene的吗??请问一下 没有人会??那有人知道NLS-SDK-2.1.0-Translations.zip能在什么地方下载到吗 ??是elipse2.1的多国语言支持 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可能是少了: writer.optimize(); writer.close();因为没有对文件进行锁定。Eclipse中文语言包下载:http://download2.eclipse.org/downloads/drops/L-2.1.x%20Translations-200307021300/eclipse2.1.1-SDK-win-LanguagePackFeature.zip下面是lucene自己带的demo:class IndexFiles { public static void main(String[] args) { try { long starttime = System.currentTimeMillis(); IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true); indexDocs(writer, new File(args[0])); writer.optimize(); writer.close(); System.out.print(System.currentTimeMillis() - starttime); System.out.println(" total milliseconds"); } catch (Exception e) { System.out.println(" caught a " + e.getClass() + "\n with message: " + e.getMessage()); } } public static void indexDocs(IndexWriter writer, File file) throws Exception { if (file.isDirectory()) { String[] files = file.list(); for (int i = 0; i < files.length; i++) { indexDocs(writer, new File(file, files[i])); } } else { System.out.println("adding " + file); writer.addDocument(FileDocument.Document(file)); } }} 如何用java正则表达式检测字符串开头是否为标点符号% ? function调用另一个function问题 运行java程序时出现错误!! 急!一个简单的错误 是什么错误呀,Cannot retrieve definition for form bean autoexportForm 一个关于小应用程序的问题??? 寻java set**(),get**()投机取巧的方法!急!!! ResultSet的简单问题,在线等,第一个对的全部给分 格式化浮点数? SCJP(YY5) 请支持刚学java的人,谢 jbuilder8中,编写代码时,光标实际位置前移,怎么解决?
writer.close();
因为没有对文件进行锁定。Eclipse中文语言包下载:http://download2.eclipse.org/downloads/drops/L-2.1.x%20Translations-200307021300/eclipse2.1.1-SDK-win-LanguagePackFeature.zip下面是lucene自己带的demo:class IndexFiles {
public static void main(String[] args) {
try {
long starttime = System.currentTimeMillis(); IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true);
indexDocs(writer, new File(args[0]));
writer.optimize();
writer.close();
System.out.print(System.currentTimeMillis() - starttime);
System.out.println(" total milliseconds"); }
catch (Exception e) {
System.out.println(" caught a " + e.getClass() +
"\n with message: " + e.getMessage());
}
} public static void indexDocs(IndexWriter writer, File file) throws Exception {
if (file.isDirectory()) {
String[] files = file.list();
for (int i = 0; i < files.length; i++) {
indexDocs(writer, new File(file, files[i]));
}
}
else {
System.out.println("adding " + file);
writer.addDocument(FileDocument.Document(file));
}
}
}