/** * create the lucene index. Gets first all search objects (experiments, interactions, proteins, cvs and biosources) * out of the database and creates then the index of these objects. This is a very trivial (first) version it writes * everything on scratch without using the RAM. It is recommanded to use instead the method 'createLuceneIndex' * * @param aSearchObject a search object */ public void createIndex( final SearchObject aSearchObject ) { SearchObjectIndexer searchObjectIndexer = new SearchObjectIndexer( analyzer, index.getPath() ); logger.info( "Write the index into: " + index.getPath() ); Collection allSearchObjects = null; Chrono time = new Chrono(); try { time.start(); allSearchObjects = dao.getAllSearchObjects(); time.stop(); System.out.println( "time to get " + allSearchObjects.size() + " search objects: " + time.toString() ); } catch ( IntactException e ) { logger.error( e ); e.printStackTrace(); } for ( Iterator iterator = allSearchObjects.iterator(); iterator.hasNext(); ) { SearchObject searchObject = ( SearchObject ) iterator.next(); searchObjectIndexer.createIndex( searchObject ); } }
/** * create the lucene index. Gets first all search objects (experiments, interactions, proteins, cvs and biosources) * out of the database and creates then the index of these objects. This is a very trivial (first) version it writes * everything on scratch without using the RAM. It is recommanded to use instead the method 'createLuceneIndex' * * @param aSearchObject a search object */ public void createIndex( final SearchObject aSearchObject ) { SearchObjectIndexer searchObjectIndexer = new SearchObjectIndexer( analyzer, index.getPath() ); logger.info( "Write the index into: " + index.getPath() ); Collection allSearchObjects = null; Chrono time = new Chrono(); try { time.start(); allSearchObjects = dao.getAllSearchObjects(); time.stop(); System.out.println( "time to get " + allSearchObjects.size() + " search objects: " + time.toString() ); } catch ( IntactException e ) { logger.error( e ); e.printStackTrace(); } for ( Iterator iterator = allSearchObjects.iterator(); iterator.hasNext(); ) { SearchObject searchObject = (SearchObject) iterator.next(); searchObjectIndexer.createIndex( searchObject ); } }