Commit every 500 records indexed so that large number of metadata can be bulk indexed without OOM exceptions.
remove extra line in template rendering