Creating or retrieving a document database