code: @Override
     void addDocuments(Document[] docs) throws IOException
     {
        for (int i = 0; i < docs.length; i++)
        {
           Document old = pending.put(docs[i].get(FieldNames.UUID), docs[i]);
           if (old != null)
           {
              Util.disposeDocument(old);
           }
           if (pending.size() >= bufferSize)
           {
              commitPending();
           }
           numDocs++;
        }
        invalidateSharedReader();
     }
docs: Overwrites the default implementation by adding the documents to a
  pending list and commits the pending list if needed.
  
  @param docs the documents to add to the index.
  @throws IOException if an error occurs while writing to the index.