searcher.setHitTextPattern("${fileName}");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("> ");
String line = br.readLine();
while (line != null) {
QueryResults results = searcher.search(null, line, null);
if (results == null) {
System.out.println("Null result");
return;
}
int len = results.length();
for (int i = 0; i < len; i++) {
System.out.println(results.getHit(i).toText());
}
System.out.print("> ");
line = br.readLine();
}
}