NEW YORK — Most of the U.S. stock market is rallying Wednesday as Wall Street tries to sort the winners from the losers following stunning losses for President Donald Trump’s party in the midterm elections. The early winners appear to include solar-power companies, for example. Investors meanwhile see risks ahead for Trump’s social-media company, the artificial-intelligence industry and businesses owned by Elon Musk, who donated heavily to Republicans. But the moves may not last, and uncertainty about what the election will mean had futures for U.S. stocks swinging from losses to gains before the U.S. market even opened. For now, at least, the S&P 500 jumped 1.2 percent in early trading and was potentially on track for its best day in six weeks. The Dow Jones Industrial Average was up 1,178 points, or 2.3 percent, as of 9:35 a.m. Eastern time, and the Nasdaq composite was 1.1 percent higher. Strategists along Wall Street had been urging investors not to get swept up in the election because it may not matter much in the long term. Historically, U.S. stocks tend to do well in the si