Modified the procedure to create index. Now it is created in parts. Also added nextDoc using binary search