for( Iterator it = docs.iterator(); it.hasNext(); ) { Content content = (Content)it.next(); content.setRemoved( true ); }
    protected void doStart()    {        String indexDirectory = IQuiver.getConfiguration().getString( "lucene.index.path" );        Criteria crit = new Criteria();        try        {            List sources = ContentSourcePeer.doSelectAll();            for (Iterator iter = sources.iterator(); iter.hasNext();)            {                ContentSource source = (ContentSource) iter.next();                crit.clear();                crit.add( ContentPeer.CONTENT_TO_DELETE, true );                crit.add( ContentPeer.CONTENT_SOURCE_ID, source.getContentSourceId() );                List docs = ContentPeer.doSelect( crit );                if (docs != null)                {                    IndexScheduler scheduler = IndexScheduler.getInstance( indexDirectory + File.separator                            + String.valueOf( source.getContentSourceId() ) );                    scheduler.scheduleForIndexing( docs );                }                                ContentPeer.doDelete( crit );            }        }        catch ( TorqueException e )        {            logger.error( "Error occured while deleting all marked contents from database!", e );        }    }