Pattern QUIT =
Pattern.compile("quit|exit|q|bye", Pattern.CASE_INSENSITIVE);
FbEntitySearcher searcher = new FbEntitySearcher(args[0], 10000, args[1]);
BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
StopWatch watch = new StopWatch();
for (; ; ) {
System.out.print("Search> ");
String question = is.readLine().trim();
if (QUIT.matcher(question).matches()) {
System.out.println("Quitting.");
break;
}
if (question.equals(""))
continue;
watch.reset();
watch.start();
List<Document> docs = searcher.searchDocs(question);
watch.stop();
for (Document doc : docs) {
LogInfo.log(
"Mid: " + doc.get(FbIndexField.MID.fieldName()) + "\t" +
"id: " + doc.get(FbIndexField.ID.fieldName()) + "\t" +
"types: " + doc.get(FbIndexField.TYPES.fieldName()) + "\t" +