Add batching of records when indexing #5465