Tries but fails to fix some bugs related to relevance ranking in search.py.