How can I create Lucene index that will have only one segment (without using force merge) I have more than enough RAM so I have tried using 1.5GB buffer size for mucj smaller index of up to 64-128MB but still having 5-10 segments at the end of indexing. What can i do about it?
public static final double DEFAULT_RAM_BUFFER_SIZE_MB_STORE = 1536.;
...
final File file = new File(pathIndex);
final Path path = file.toPath();
final Directory index = ControlObjectsLuceneIndex.createDirectory(path, file);
final IndexWriterConfig indexWriterConfig = new IndexWriterConfig(analyzer);
indexWriterConfig.setRAMBufferSizeMB(defaultRamBufferSizeMb);
indexWriterConfig.setSimilarity(_ekspertSimilarity);
indexWriterConfig.setUseCompoundFile(false);
return new IndexWriter(index, indexWriterConfig);