this.getLogger().debug("field added: " + fielddecl);
docdecl.addFieldDef(fielddecl);
}
Index index = new Index();
index.setID(id);
index.setIndexer(indexerRole);
// if the directory path is relative, prepend context path:
if (!directory.startsWith(File.separator)) {
directory = getServletContextPath() + File.separator + directory;
}
if (index.setDirectory(directory)) {
this.getLogger().warn("directory " + directory + " was locked ");
}
if (analyzerid != null) {
index.setDefaultAnalyzerID(analyzerid);
}
index.setStructure(docdecl);
index.setManager(manager);
this.addIndex(index);
this.getLogger()
.info("add index " + index.getID() + " for directory " + directory);
}
} catch (ServiceException e) {
throw new ConfigurationException("AnalyzerManager lookup error", e);
} catch (Exception e) {
throw new ConfigurationException(e.getMessage(), e);