Is it possible to selectively disabled search logging?
We are often reviewing and testing the results of searches based on the log to make sure that the most relevant content is been served as well as using it as a source of potential new content.
My question is that is there anyway we can turn off logging for admin (or any logged in) users.
I've had a look through the hooks and can't find anything there that can help.
Many thanks
Replies
Low 12 Sep 2014 08:33
Actually, you should be able to use the low_search_catch_search hook for this. Instead of modifying the given $data (which you should return unchanged), you can change the settings so the logging isn't triggered.
- Get all the settings using ee()->low_search_settings->get();
- Change the search_log_size value to 0 if the current user is logged in;
- Set the new settings using ee()->low_search_settings->set($settings);
Just make sure $settings is an array containing all settings you got from the first point.