lucene:no segments* file found in org.apache.lucen

xiaoxiao2026-05-20  11

lucene创建索引中的构造函数IndexWriter(String path, Analyzer a, boolean create, IndexWriter.MaxFieldLength mfl) ,这里的boolean create参数的意思并非是否创建索引,而是覆盖还是追加的意思。原文见官方文档:create - true to create the index or overwrite the existing one; false to append to the existing index [quote]create - true to create the index or overwrite the existing one; false to append to the existing index true:创建新的索引或者覆盖现有索引 false:追加索引到现有索引。[/quote] 所以。当该参数为false,而所以目录下由不存在索引的时候,便会产生该异常。 [quote]java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@.....[/quote] [quote]http://www.exceljava.com/?p=235[/quote]
转载请注明原文地址: https://www.6miu.com/read-5049104.html

最新回复(0)