for (int i = 0; i < list.length; i++) {
log.trace("Index Creation: " + list[i].indexer.getName());
}
}
Stopwatch sw = new Stopwatch("Populated Indexes", true);
for (int i = 0; i < list.length; i++) {
try {
if (!list[i].indexer.exists()) {
list[i].indexer.create();
}
list[i].indexer.open();
} catch (Exception e) {
if (log.isWarnEnabled()) {
log.warn("Failed to create/open indexer " + list[i], e);
}
}
}
RecordSet rs = collection.getFiler().getRecordSet();
while (rs.hasMoreRecords()) {
// Read only key, we don't need filer-level value
Key key = rs.getNextKey();
Object value = collection.getEntry(key);
if (value instanceof Document) {
// Document doc = new DocumentImpl(rec.getValue().getData(), symbols, new NodeSource(collection, key));
try {
new SAXHandler(key, (Document)value, ACTION_CREATE, list);
} catch (Exception e) {
if (log.isWarnEnabled()) {
log.warn("Failed to index document " + key, e);
}
}
}
}
for (int i = 0; i < list.length; i++) {
try {
list[i].indexer.flush();
} catch (Exception e) {
if (log.isWarnEnabled()) {
log.warn("ignored exception", e);
}
}
list[i].status = STATUS_READY;
}
sw.stop();
if (log.isDebugEnabled()) {
for (int i = 0; i < list.length; i++) {
log.debug("Index Complete: " + list[i].indexer.getName());
}
log.debug(sw.toString());
}
}
}