【问题标题】:RAMDirectory LuceneRAM 目录 Lucene
【发布时间】:2012-05-29 16:47:06
【问题描述】:

我正在尝试索引文本文件并使用 RAMDirectory 进行快速索引,并且想知道是否有办法清除以前的 RAMDirectory 以防止重复?

【问题讨论】:

    标签: java text lucene indexing ramdirectory


    【解决方案1】:

    不确定“清除先前的 RAMDirectory”是什么意思,但您可以通过将创建标志字符串设置为 true 来覆盖 RAMDir 中的先前索引。这将在构造函数调用的位置创建一个新索引。

    IndexWriter(Directory d, Analyzer a, boolean create, IndexWriter.MaxFieldLength mfl) 
    

    Constructs an IndexWriter for the index in d.

    【讨论】:

    • 谢谢。我得到了它。我只是忘了关闭 IndexWriter。
    猜你喜欢
    • 2013-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-01
    • 1970-01-01
    • 2013-11-13
    • 1970-01-01
    • 2014-01-09
    相关资源
    最近更新 更多