1823, "treasury, storehouse," from Latin thesaurus "treasury, a hoard, a treasure, something laid up," figuratively "repository, collection," from Greek thēsauros "a treasure, treasury, storehouse, chest," related to tithenai "to put, to place." According to Watkins, it is from a reduplicated form of PIE root *dhe- "to set, put," but Beekes offers: "No etymology, but probably a technical loanword, without a doubt from PreGreek."
The meaning "encyclopedia filled with information" is from 1840, but existed earlier as thesaurarie (1590s), used as a title by early dictionary compilers, on the notion of thesaurus verborum "a treasury of words." Meaning "collection of words arranged according to sense" is first attested 1852 in Roget's title. Thesaurer is attested in Middle English for "treasurer" and thesaur "treasure" was in use 15c.-16c.