When generating index, reformat JSON by chunks.

It seems that output is too large for json_reformat to digest it in one
go.