Deputies were ambushed as they approached a home to serve a search warrant as part of a prostitution investigation.