code: public boolean hasDeletions() throws CorruptIndexException, IOException
     {
        boolean result = false;
  
        for (PersistentIndex index : indexes)
        {
           IndexWriter writer = index.getIndexWriter();
           result |= writer.hasDeletions();
        }
  
        return result;
     }
docs: Checks if index has deletions.