Learning-to-rank, which is a machine-learning technique for information retrieval, was recently introduced to ligand-based virtual screening to reduce the costs of developing a new drug. The quality of a rank prediction model depends on experimental data such as the compound activity values used for learning. However, activity values that contain a large error could lead to the observation of meaningless order relations at a certain rate. This motivated us to develop a novel learning-to-rank method that ignores two meaningless types of order ranking: those between compounds with similar activity and those between inactive compounds. We evaluated the proposed method using five high-throughput screening assay datasets from the PubChem BioAssay database. The results demonstrated that the proposed method could improve the accuracy of the prediction results by ignoring meaningless ranking orders to overcome the virtual screening problem. We confirmed that, although the proposed method is based on a simple idea, it facilitates accurate virtual screening. The source code is publicly available at https://github.com/akiyamalab/SPDRank.