How would you implement a search engine for text documents?

Technical