Make the number of indexing threads an argument