Local search in a topological ordering space is an efficient way of learning Bayesian network structures in large-scale problems. However, existing algorithms typically focus on stochastically developing the neighborhood of an ordering without a specific direction and can quickly stop at a local optimum. In this study, a novel approach is proposed to improve the capability of a local search by determining the search direction. The direction of the search step is identified with respect to the priority in a score cache. We also design robust terminal conditions and insertion methods based on the proposed operator. The direction of escaping from local optima is identified by transferring the ordering to a new restart, which implies an equivalent class of the optimal structure. Moreover, we adopt a breadth-first search method for the conversion between structures and orderings. The identification of the direction can accelerate the convergence of the local search and acquire the higher quality structure. Furthermore, our experimental results demonstrated that the proposed methods highly improve the accuracy and efficiency of learning the optimal ordering from the training dataset compared with state-of-the-art algorithms.