code: @Override
     int removeDocument(Term idTerm) throws IOException
     {
        Document doc = pending.remove(idTerm.text());
        int num;
        if (doc != null)
        {
           Util.disposeDocument(doc);
           // pending document has been removed
           num = 1;
        }
        else
        {
           // remove document from index
           num = super.getIndexReader().deleteDocuments(idTerm);
        }
        numDocs -= num;
        return num;
     }
docs: Overwrites the default implementation to remove the document from the
  pending list if it is present or simply calls <code>super.removeDocument()</code>.
  
  @param idTerm the uuid term of the document to remove.
  @return the number of deleted documents
  @throws IOException if an error occurs while removing the document from
  the index.