I have a usage pattern where I need to package up and store away all files from an index referenced by multiple commit points. To that end, I basically call IndexWriter.commit(), followed by SnapshotDeletionPolicy.snapshot(), followed by something like this:
List<String> files = new ArrayList<String>(dir.listAll().length); for (IndexCommit commit: snapshotter.getSnapshots()) { files.addAll(commit.getFileNames()); } As it turns out, this creates duplicates, specifically some .si files appear to be present in multiple commit points. Is this expected, and if so - does this mean that some commits are allowed to reuse segments created by prior commits? I have always thought that each commit creates a new set of segments... I'm using Lucene 4.6.