         # File lib/ferret/index.rb, line 451
    451:     def doc(*arg)
    452:       @dir.synchronize do
    453:         id = arg[0]
    454:         if id.kind_of?(String) or id.kind_of?(Symbol)
    455:           ensure_reader_open()
    456:           term_doc_enum = @reader.term_docs_for(@id_field, id.to_s)
    457:           return term_doc_enum.next? ? @reader[term_doc_enum.doc] : nil
    458:         else
    459:           ensure_reader_open(false)
    460:           return @reader[*arg]
    461:         end
    462:       end
    463:     end