A law enforcement officer was shot when authorities tried to execute a search warrant in Olivehurst, the Yuba County Sheriff’s Office said Wednesday.