code: private void commitPending() throws IOException
     {
        if (pending.isEmpty())
        {
           return;
        }
        super.addDocuments((Document[])pending.values().toArray(new Document[pending.size()]));
        pending.clear();
        aggregateIndexes.clear();
     }
docs: Commits pending documents to the index.
  
  @throws IOException if committing pending documents fails.