System.err.println("Usage: " + usage);
return;
}
IndexConfiguration ie = new IndexConfiguration(argv[0]);
index = ie.resolvePath(ie.getIndexDir());
root = new File(ie.resolvePath(ie.getHTDocsDumpDir()));
if (ie.getUpdateIndexType().equals("new")) {
create = true;
} else if (ie.getUpdateIndexType().equals("incremental")) {
create = false;
} else {
System.err.println("ERROR: No such update-index/@type: " + ie.getUpdateIndexType());
return;
}
String debug = argv[1];
if (debug.equalsIgnoreCase("false") || debug.equalsIgnoreCase("no")) {
DebugConfiguration.setDebug(false);
} else if (debug.equalsIgnoreCase("true") || debug.equalsIgnoreCase("yes")) {
DebugConfiguration.setDebug(true);
} else {
System.err.println("ERROR: <debug> must be one of 'yes', 'true', 'no', or 'false'");
}
/*
for (int i = 0; i < argv.length; i++) {
if (argv[i].equals("-index")) { // parse -index option
index = argv[++i];
} else if (argv[i].equals("-create")) { // parse -create option
create = true;
} else if (i != argv.length-1) {
System.err.println("Usage: " + usage);
return;
} else
root = new File(argv[i]);
}
*/
Date start = new Date();
Indexer indexer = (Indexer) ie.getIndexerClass().newInstance();
DOMUtil du = new DOMUtil();
Document config = new DOMParserFactory().getDocument(argv[0]);
indexer.configure(du.getElement(config.getDocumentElement(), new XPath("indexer")), argv[0]);