public void generate ( ) throws WikiApiException { Indexer data = null ; try { data = new Indexer ( config ) ; System . out . println ( "GENERATING INDEX STARTED" ) ; long bufferSize = config . getBufferSize ( ) ; Revision rev ; long count = 0 ; long last = 0 , now , start = System . currentTimeMillis ( ) ; Iterator < Revision > it = new IndexIterator ( config ) ; while ( it . hasNext ( ) ) { if ( ++ count % bufferSize == 0 ) { now = System . currentTimeMillis ( ) - start ; System . out . println ( Time . toClock ( now ) + "\t" + ( now - last ) + "\tINDEXING " + count ) ; last = now ; } rev = it . next ( ) ; data . index ( rev ) ; } System . out . println ( "GENERATING INDEX ENDED + (" + Time . toClock ( System . currentTimeMillis ( ) - start ) + ")" ) ; } catch ( Exception e ) { throw new WikiApiException ( e ) ; } finally { if ( data != null ) { data . close ( ) ; } } }
Starts the generation of the indices .