摘要 |
The invention discloses a method and a device for building an index database as well as a method and a device for querying. The method for building an index database comprises the following steps of: collecting electronic documents; extracting keywords in the electronic documents; classifying the keywords into first-class keywords, second-class keywords and third-class keywords; filtering out the first-class keywords and the second-class keywords; and building an inverted index aiming at the third-class keywords, wherein the first-class keywords, the second-class keywords and the third-class keywords belong to different classes of keywords. In the embodiment of the invention, a method for classifying keywords is adopted, and the keywords without a need to build an index are eliminated, thus saving the space of a disk; and moreover, in the case that the queried keywords are the keywords without a need to build an index, the index database is not queried, thus saving the overhead of the read-write operation of the disk. |