code: public static void disposeDocument(final Document old)
     {
        for (Iterator<Fieldable> it = old.getFields().iterator(); it.hasNext();)
        {
           Fieldable f = it.next();
           try
           {
              if (f.readerValue() != null)
              {
                 f.readerValue().close();
              }
              else if (f instanceof TextFieldExtractor)
              {
                 TextFieldExtractor field = (TextFieldExtractor)f;
                 field.dispose();
              }
           }
           catch (IOException ex)
           {
              log.warn("Exception while disposing index document: " + ex);
           }
        }
     }
docs: Disposes the document <code>old</code>. Closes any potentially open
  readers held by the document.
  
  @param old the document to dispose.