?? index.java~32~
字號:
package news;
/**
* <p>Title: 新聞搜索引擎</p>
* <p>Description: 畢業設計</p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author 計算機99630 沈晨
* @version 1.0
*/
import java.io.IOException;
import org.apache.lucene.analysis.cn.ChineseAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexWriter;
public class Index {
IndexWriter _writer = null;
Index() throws Exception {
_writer = new IndexWriter("c:\\News\\index",
new ChineseAnalyzer(), true);
}
/*
void AddNews(String url,String title)throws Exception {
Document _doc = new Document();
_doc.add(Field.Text("title",title));
_doc.add(Field.UnIndexed("url",url));
_writer.addDocument(_doc);
}
void close()throws Exception{
_writer.optimize();
System.out.println(_writer.docCount());
_writer.close();
}*/
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -