typeahead and search functioning