Recently, with the rapid development of wireless communication technologies, indoor positioning has been gradually applied to many occasions, such as positioning in complex multi-floor shopping malls. In the positioning of shopping malls, the Wi-Fi fingerprint positioning method is often used. Moreover, k-nearest neighbor algorithm is commonly used to estimate the position of the target point in some studies. However, the k-nearest neighbor algorithm searched in the database of the whole building, resulting in low accuracy of floor determination, large positioning errors, and large amount of calculation. To solve this problem, the database of a building should be reasonably divided into several clusters, and the clusters with the highest similarity to the target point should be used for positioning. Therefore, in this paper, a building fingerprint database clustering method based on signal distance and position distance is proposed. The results show that compared with the k-nearest neighbor algorithm, the floor determination accuracy is improved, and the positioning error is reduced.