Create reference for search

Taken from Example 2 on http://www.javapractices.com/topic/TopicAction.do?Id=87