The Dow surged more than 1,200 points, while other stock indexes jumped as investors digested the impact of the midterms.