* Adds indexes from the given configuration object to the index manager.
* @param configuration
* @throws ConfigurationException
*/
private void addIndexes(Configuration configuration) throws ConfigurationException {
AnalyzerManager analyzerManager = null;
MetaDataFieldRegistry registry = null;
Configuration[] confs = configuration.getChildren(INDEX_ELEMENT);
if (confs.length == 0) {
throw new ConfigurationException("no index is defined !");
}
try {
analyzerManager = (AnalyzerManager) this.manager.lookup(AnalyzerManager.ROLE);
registry = (MetaDataFieldRegistry) this.manager.lookup(MetaDataFieldRegistry.ROLE);
// configure each index
for (int i = 0; i < confs.length; i++) {
String id = confs[i].getAttribute(ID_ATTRIBUTE);
String analyzerid = confs[i].getAttribute(INDEX_DEFAULTANALZER_ATTRIBUTE, null);
if (analyzerid != null && !analyzerManager.exist(analyzerid)) {
throw new ConfigurationException("Analyzer " + analyzerid + " no found");
}
String directory = confs[i].getAttribute(INDEX_DIRECTORY_ATTRIBUTE);