Solr is a search engine, which aggregates data and stores them in an indexed manner, and provides fast lookup. It uses Apache Lucene for indexing.
You could query Solr for a string, and it will return a list of matches, which can then be displayed in your website.
Refer to this presentation for an introduction to Solr.
Note that Solr gives a lot of features to enhance your user experience, i.e Faceted Navigation etc.