Optimization for awarding badge to user search