`
gcgmh
  • 浏览: 349428 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

lucene tips

阅读更多
1、
IndexWriter writer = new IndexWriter(INDEX_DIR, new StandardAnalyzer(), true);

它使用的IndexWriter的一个构造函数,定义如下所示:

public IndexWriter(String path, Analyzer a, boolean create)
       throws CorruptIndexException, LockObtainFailedException, IOException {
    init(FSDirectory.getDirectory(path), a, create, true, null, true);
}

这个构造函数具有三个参数:

path   :根据一个字符串描述的路径,为建立的索引文件指定存放目录。

a        :一个分析器。

create:它是一个boolean型变量,如果为true,表示要重写指定的存放索引目录下的索引文件;如果为false,表示在指定存放索引目录下已经存在的索引文件的基础上,向其中继续追加新的索引文件。

----------------------------------------------------------------------
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics