1. A document retrieval method for a document retrieval system that retrieves documents containing a specified string out of a set of documents registered beforehand, said document retrieval method comprising the steps of: performing a word extraction operation for text data in a document to be registered; identifying top-of-word positions and bottom-of-word positions in said text data; creating text data in which identification information indicating tops of words and ends of words are added to top-of-word characters and end-of-word characters respectively; extracting an n-gram, which is a sub-string of a predetermined length, from said created text data; and creating and storing a search index containing information extracted from said extracted n-gram, said information including character position information extracted from said extracted n-gram and top-of-word boundary information if a leading character of said n-gram is at a leading position of a word and end-of-word boundary information if a trailing character of said n-gram is at a trailing position of a word, said character position information including text identification information and occurrence position information which indicates that the string is located at the n-th position from the beginning of said text data.