Group documents by year.