Paul James Owens, 36, was challenged by Detective Constable Richard Dove on November 25 in Victoria Walk, Leeds city centre, after being suspecting of shoplifting.
But after approaching him, the detective was slashed in the face, neck and hand by Owens and taken to hospital.
Owens, of no fixed abode, was jailed today (Tuesday) for six years and 147 days at Leeds Crown Court after admitting wounding with intent to resist arrest, possession of a bladed article and attempted theft.
The offences happened on the same day as the Black Friday sales, when retailers offer cut-price deals on products in the run up to Christmas.
Following the sentencing today, Det Con Dove has been praised for his bravery in confronting Owens.
Detective Chief Superintendent Julie Sykes, of West Yorkshire Police's Professional Standards Department, said: "Day in day out police officers put themselves in harms way in order to protect members of the public.
"Richard's bravery shows that police officers are never 'off duty' even when they are not at work.
"I am pleased with the sentence handed down to Owens which sends out a clear message that assaults on police officers will not be tolerated."
Det Con Dove has since recovered from his injuries and returned to work.