When we create a lucene index, various files are created. If we do not optimize Index writer开发者_运维技巧 three files are created, one named _0.cfs which contains all of the index data and two other files containing meta data. Is it possible to force lucene to create only one file instead of three.
No. It is not possible to do that because Lucene is designed to be efficient for Incremental indexing. Lucene creates multiple segments to make incremental indexing fast. Each segment has a separate .cfs file. The segments file contain information about the different segments and which .cfs file is for which segment. This means that segments file cannot be folded into any of the .cfs files.
精彩评论