1. A medium computer-readably storing a document retrieval program for causing a computer to execute a process of retrieving a document having a first classification code assigned thereto in a database of documents, the first classification code being a classification code having a hierarchical structure, the process comprising: an acquisition step that acquires the first key information, or the key for retrieving a document; a first retrieval step that causes documents containing the first key information to be retrieved from a predetermined range in the database; a first extraction step that extracts the first classification codes from the documents retrieved by the first retrieval step as candidate classification codes, the first classification code being related to the documents; a second retrieval step that causes documents containing candidate classification codes to be retrieved from the predetermined range; a second extraction step that extracts the second key information contained in the documents retrieved by the second retrieval step, the second key information being of the type same as the first key information; and an evaluation step that evaluates the candidate classification codes on the basis of comparison of the first key information and the second key information.