In mining and analyzing high-dimensional data task, when only a small number of pairwise constraints including must-link and cannot-link are available, supervised dimensionality reduction methods tend to perform poorly due to the lack of data labels. In such cases, unlabeled samples could be useful in improving the performance. In this paper, we propose a novel semi-supervised locality dimensionality reduction algorithm (SLDR) in terms of pairwise constraints and abundant unlabeled samples. Specifically, SLDR can effectively use local information of the data and pairwise constraints to find a projection. After the data is projected onto a low-dimensional space, instances involved by cannot-link constraints are far apart, while instances involved by must-link constraints are close to each other. Moreover, the intrinsic geometric information of the data is preserved. In addition, SLDR can be extended to nonlinear dimensionality reduction scenarios by the kernel trick, which is applied to reduce the dimensions of highly nonlinear data.