Improved search function to take in account the space between names in autocomplete.