So I had a look in the file XF/Pub/Controller/Search.php and I am trying to figure out why when a user searches for something, and there are no results, the search is not stored in the xf_search table. It only stores a search in there if results are found.