use of org.apache.lucene.index.CheckIndex.Status in project zm-mailbox by Zimbra.
the class LuceneViewer method doCheck.
private static void doCheck(CommandLine cl) throws Exception {
Console console = new Console(cl.hasOption(CLI.O_VERBOSE));
String indexDir = cl.getOptionValue(CLI.O_INPUT);
console.info("Checking index " + indexDir);
Directory dir = null;
try {
dir = LuceneDirectory.open(new File(indexDir));
} catch (Throwable t) {
console.info("ERROR: could not open directory \"" + indexDir + "\"; exiting");
t.printStackTrace(System.out);
System.exit(1);
}
CheckIndex checker = new CheckIndex(dir);
checker.setInfoStream(System.out);
Status result = checker.checkIndex();
console.info("Result:" + (result.clean ? "clean" : "not clean"));
}
Aggregations