added userId to search query for logging and search history