LogInit.init();
File dataDir = new File("./data/shakespeare");
logger.info( "Looking for XML files in " + dataDir.getAbsolutePath() );
FilenameFilter xmlFilter = new GlobFilenameFilter( "*.xml" );
File[] xmlFiles = dataDir.listFiles( xmlFilter );
logger.info( "Creating Index");
IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true);
PlayIndexer playIndexer = new PlayIndexer( writer );
playIndexer.init();
for (int i = 0; i < xmlFiles.length; i++) {
System.out.println( "Indexing: " + xmlFiles[i] );
playIndexer.index(xmlFiles[i]);
}
writer.optimize();
writer.close();
logger.info( "Parsing Complete, Index Created");