If you want to know some of the techniques, read "Managing Gigabytes: Compressing and Indexing Documents and Images" by Ian H. Witten, Alistair Moffat, and Timothy C. Bell.
If you want to actually implement search for your users, use solr. And use Tika for extracting text from Word documents.