public synchronized void commit() throws IcatException {
   try {
     int cached = iwriter.numRamDocs();
     iwriter.commit();
     if (cached != 0) {
       logger.debug(
           "Synch has committed "
               + cached
               + " changes to Lucene - now have "
               + iwriter.numDocs()
               + " documents indexed");
     }
   } catch (IOException e) {
     throw new IcatException(IcatExceptionType.INTERNAL, e.getMessage());
   }
 }