LogInit.init();
logger.info("Searching for " + pArgs[0]);
Searcher searcher = new IndexSearcher("index");
Analyzer analyzer = new SimpleAnalyzer();
Query query = QueryParser.parse(pArgs[0], "speech", analyzer);
Hits hits = searcher.search(query);
logger.info( "Searching Done, hit: " + hits.length() );
System.out.println( "Score | Play | Act | Scene | Speaker" );
for( int i = 0; i < hits.length(); i++ ) {
Document doc = hits.doc(i);
System.out.print( (int) (hits.score(i) * 100 ) );
System.out.print( " | " + doc.get("play") + " | " + doc.get("act") );
System.out.print( " | " + doc.get("scene") );
System.out.print( " | " + doc.get("speaker") + "\n" );
}