Get search query from history's location