* TSX ends up 0.1% at 21,125.28

* Posts its highest closing level since May 2022

* Technology rallies 0.8%

* Energy gains 0.4%; oil settles higher

Jan 26 (Reuters) - Canada's main stock index ended higher on Friday as technology and energy shares gained ground, with the market adding to gains this week that have lifted the index to a 20-month high.

Toronto Stock Exchange's S&P/TSX composite index ended up 23.74 points, or 0.1%, at 21,125.28, its highest closing level since May 2022. For the week, the index was up 1.0%.

"Not unlike the U.S., certainly technology and information services are driving things," said Lorne Steinberg, president, Lorne Steinberg Wealth Management Inc. "That seems to be the theme of the world ... one of the only sectors that really has that strong growth."

Technology rallied 0.8% and energy was up 0.4%. The latter was helped by higher oil prices, with crude futures settling 0.8% higher at $78.01 a barrel, as well as gains for pipeline companies, which tend to pay high dividends.

The move in pipelines is down to "the perception that even if interest rates don't go down quickly they will probably be cut at some point in time," Steinberg said.

U.S. prices rose marginally in December, bolstering expectations that the Federal Reserve will start cutting interest rates this year.

On Wednesday, the Bank of Canada said it its focus is shifting to when to cut borrowing costs rather than whether to hike again.

The materials group, which includes precious and base metals miners and fertilizer companies, was one of the laggards, falling 0.5% as the price of gold edged lower. (Reporting by Fergal Smith in Toronto and Purvi Agarwal in Bengaluru; Editing by Ravi Prakash Kumar and Sandra Maler)