• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

search-terms: what are people searching for?

erich37

Well-known member
#1
is there any chance to see what people are searching for on my forum ?

I mean: as an Admin, can I se what kind of search-terms people are entering into the search-box ?

thanks!
 

Jake Bunce

XenForo moderator
Staff member
#2
Searches are cached in the xf_search table. Those records remain for up to 24 hours before they are pruned. You need to modify the code if you want those records to stay:

library/XenForo/CronEntry/CleanUp.php

Add the red code to comment out that line:

Code:
	public static function runDailyCleanUp()
	{
		$db = XenForo_Application::get('db');

		// delete old thread/forum read marking data
		$readMarkingCutOff = XenForo_Application::$time - (XenForo_Application::get('options')->readMarkingDataLifetime * 86400);
		$db->delete('xf_thread_read', 'thread_read_date < ' . $readMarkingCutOff);
		$db->delete('xf_forum_read', 'forum_read_date < ' . $readMarkingCutOff);

		// delete old searches
		// $db->delete('xf_search', 'search_date < ' . (XenForo_Application::$time - 86400));
	}
Or a more permanent solution would require an addon.
 

Cezz

Well-known member
#3
You can do a mysql query along the lines of

Code:
select search_query,user_id from xf_search where search_type NOT IN ("recent-threads","new-threads","user") AND search_query NOT Like "/search%" order by search_id desc limit 0,25;
Which would show you the last 25 search queries that were made in the last 24 hours (due to pruning)

This could also technically be turned into an addon but I don't have a need so won't be doing it myself.
 

erich37

Well-known member
#8
I do not need it. The benefit is zero for me.
But Erich need everything. :D
hahaha

well, I see people searching all the time at my forums and wondering what they are searching for, especially given the fact that any search-result is merely an Error-page saying "not found"......
 
F

Floris

Guest
#10
Yep, only by admins would be nice, it helps determine what content we're missing. Even if this is a rolling 24h thing ..