Forgot to close the Lucene IndexWriter after adding Documents to the index

空扰寡人 提交于 2019-12-05 17:59:17

Calling IndexWriter.optimize() is not necessary and can be called at a later time by reopening the index. It just optimizes the documents in the index for better read performance and doesn't otherwise affect anything.

If you forgot to call IndexWriter.close() however then your index might not be complete. Since you processed so many documents it likely flushed most of them, so hopefully you only need to re-index the last ones. Use Luke as suggested for a UI to quickly browse the index to see what state it's in.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!