I've been on the job search a few times now, but I still get the emotional swings. I guess it'll never go away, so the only thing you can do is make the experience less painful.
I came across this quote by Jack Kornfield on Tim Ferriss' podcast.
Let suffering teach you compassion because in Tibet, in some of the Tibetan teachings, they actually pray for suffering. They say, "May I be granted enough suffering so that the great heart of compassion will open in me."
It's a helpful reframing, to think of the experience as another rep at the emotional gym.