         # File lib/ferret/index.rb, line 412
    412:     def doc(*arg)
    413:       @dir.synchronize do
    414:         id = arg[0]
    415:         if id.kind_of?(String) or id.kind_of?(Symbol)
    416:           ensure_reader_open()
    417:           term_doc_enum = @reader.term_docs_for(@id_field, id.to_s)
    418:           return term_doc_enum.next? ? @reader[term_doc_enum.doc] : nil
    419:         else
    420:           ensure_reader_open(false)
    421:           return @reader[*arg]
    422:         end
    423:       end
    424:     end