To encourage the use of search on my forum I’ve created badges for using the search function. I’ve created three badges (First >=1, Great >=50 and Epic >=200) but you can choose how many badges and the values for yourself.
SELECT user_id, min(created_at) AS granted_at
FROM search_logs
WHERE user_id IS NOT NULL
GROUP BY user_id
HAVING count(*) >= ... --[! Add the number of times search used]