handle case where number of documents is less or equal the number of partitions