Are you trying to rewrite your already created index into a different segment geometry?
Maybe have a look at the new IndexRearranger tool <https://issues.apache.org/jira/browse/LUCENE-9694>? It is already doing something like what you enumerated below, including mocking LiveDocs to get the right documents into the right segments. Mike McCandless http://blog.mikemccandless.com On Sat, May 22, 2021 at 3:50 PM Ravikumar Govindarajan < ravikumar.govindara...@gmail.com> wrote: > Hello, > > We have a use-case for index-rewrite on a "frozen index" where no new > documents are added. It goes like this.. > > 1. Get all segments for the index (base-segment-list) > 2. Create a new segment from base-segment-list with unique set of docs > (LiveDocs) > 3. Repeat step 2, for a fixed count. Like say 5 or 10 times > > Is something like this achievable via Merge Policy? We can disable commits > too, till the full run is completed. > > Any help is appreciated > > Regards, > Ravi >