Manager Bruce Bochy said Torres was to have a minimally invasive laparoscopic procedure.
It's a big blow for the Giants, who are chasing the San Diego Padres in the NL West and have come to rely on Torres at all three outfield spots.
"These things happen. You hate to see it," Bochy said before Sunday's finale of a four-game showdown against the Padres. "I feel terrible for Andre, with the year he's having and what a great job he's done, but we have depth here. These guys need to see it's a great opportunity, and you have to move on. That's what we're going to do here. It's a good club with a lot of depth. Right now, it's coming in handy."
Torres had been hitting .287 before going through a 5-for-47 slump with 17 strikeouts in his last 12 games to drop his average to .269. He has 14 homers, 60 RBIs and a team-high 23 stolen bases.
The 32-year-old Torres emerged as an everyday player in his second year with San Francisco. He toiled through 12 years in the minors -- eight at the Triple-A level -- before finally getting his shot. Many teams passed on him based on his size: 5-foot-10, 175 pounds.
His impressive play in the field, at the plate and on the basepaths forced Bochy to make room for Torres in the starting lineup and move veteran Aaron Rowand into a backup role.