It doesn't look like it has a grounded plug. Not that I'm insisting you ground it, just noting that's why you got a shock instead of popping a circuit breaker. But now that you've had the shock, take a moment to reflect on how harmless it was. Fun fact, if you plug it into a GFCI outlet and attempt to be shocked by it, it should trip the GFCI.
Does it run, anyway?
One does not simply get a shock by touching just one thing. You must have been in contact with something else at the same time. Which is very likely you were in contact with something grounded, like a plumbing fixture, light switch cover plate screw, etc. Knowing that, the fault is most likely on the Line side of the power within the vacuum (because ground and Neutral/common are the same).
Like Les says, suspect the switch first, and inspect EVERY INCH of the cord, both outside and inside the handle, etc. I bet if you remove the switch you will see something. Probably someone replaced the switch and did a botch job.