- 浏览: 54063 次
- 性别:
- 来自: 深圳
文章列表
public class PageTag implements Tag {
private PageContext pageContext;
private int pageNum;
private String tableName;
public PageTag(){
System.out.println("PageTag...............");
}
public int doEndTag() throws JspException {
// TODO Auto-generated method stub
return 0;
}
...
public class IndexDao {
String indexPath = "E:\\luceneIndex";
// Analyzer analyzer = new StandardAnalyzer();
Analyzer analyzer = new MMAnalyzer();// 词库分词
/**
* 添加/创建索引
*
* @param doc
*/
public void save(Document doc) {
IndexWriter indexWriter = null;
try {
indexWriter = ...
Analyzer analyzer = new StandardAnalyzer();
/**
* 创建索引
*
* IndexWriter 是用来操作(增、删、改)索引库的
*/
@Test
public void createIndex() throws Exception {
// file --> doc
Document doc = File2DocumentUtils.file2Document(filePath);
// 建立索引
IndexWriter indexWriter = new IndexWriter(indexPath ...