def update(id, new_doc)
      @dir.synchronize do
        ensure_writer_open()
        delete(id)
        if id.is_a?(String) or id.is_a?(Symbol)
          @writer.commit
        else
          ensure_writer_open()
        end
        @writer << new_doc
        flush() if @auto_flush
      end
    end
def update(id, new_doc)
      @dir.synchronize do
        ensure_writer_open()
        delete(id)
        if id.is_a?(String) or id.is_a?(Symbol)
          @writer.commit
        else
          ensure_writer_open()
        end
        @writer << new_doc
        flush() if @auto_flush
      end
    end
Update the document referenced by the document number +id+ if +id+ is an
 integer or all of the documents which have the term +id+ if +id+ is a
 term..
 For batch update of set of documents, for performance reasons, see batch_update

 id::      The number of the document to update. Can also be a string
           representing the value in the +id+ field. Also consider using
           the :key attribute.
 new_doc:: The document to replace the old document with