Back-End Engineer (Python): optimize the search module