Fixed Search component's index search bug.

If the index contains no entries and a reader is created Lucene throws an exception. Added check for the size of the index before performing a search.