I'm not sure that I follow ... where do you see DocMap being loaded up front? Specifically, Sorter.sort may return null of the readers are already sorted ... I think we already optimized for the case where the readers are sorted.
Shai On Tue, Jun 17, 2014 at 4:04 AM, Ravikumar Govindarajan < ravikumar.govindara...@gmail.com> wrote: > I am planning to use SortingMergePolicy where all the merge-participating > segments are already sorted... I understand that I need to define a DocMap > with old-new doc-id mappings. > > Is it possible to optimize the eager loading of DocMap and make it kind of > lazy load on-demand? > > Ex: Pass List<AtomicReader> to the caller and ask for next new-old doc > mapping.. > > Since my segments are already sorted, I could save on memory a little-bit > this way, instead of loading the full DocMap upfront > > -- > Ravi >