A late-afternoon recovery in technology stocks helped erase most of the market’s losses Friday, though it wasn’t enough to keep major indexes from posting their second straight losing week. The S&P 500 eked out a 0.1 percent gain in the final minutes of trading after having been down about 1 percent earlier in the day. The tech-heavy Nasdaq came back from a 0.8 percent slide to post a 0.6 percent gain. The Dow Jones Industrial Average fell 0.6 percent. The rally in technology stocks, plus gains in energy and other sectors, helped outweigh declines in banks and elsewhere in the market on a day when investors were mainly focused on a mix of company earnings reports and discouraging data on retail sales. The mixed finish capped a week of choppy trading on Wall Street that deepened the market’s January slump. The benchmark S&P 500, which soared 26.9 percent in 2021, …