After he retired, he decided to publish a system of classifying words into groups based on their meanings. It was not the first book of synonyms, but it was the most comprehensive.
He organized all the words into six categories: Abstract Relations, Space, Matter, Intellect, Volition, Sentient and Moral Powers, and within each category there were many subcategories. The project took him more than 10 years, but he finally published his Thesaurus of English Words and Phrases in 1852. He chose the word "thesaurus" because it means "treasury" in Greek.
It was only at the last minute that he decided to include an index, which made it become one of the most popular reference books of all time.
I love that Word now has a thesaurus. I use it on a daily basis.