On a more serious note: you can create a template operator that executes exactly that php call, and add it to your templates that do the within-template search.
But for the long-term sustainability, I think we should add a 'register_in_logs' param to the search fetch function.
You could even write your custom search fetch function that calls the underlying one and adds the search logging...
Principal Consultant International Business
Member of the Community Project Board
Template operator could be the eaZy way right now, but it should be added into search functions (not in content/search) to have more uniform solution...