Updated IndexSearcher class.

Added a method that checks the compatibility of the similarity function being used for search and index. We also added the call to this method in the search() function of the same class.