if (analyzer == null) {
throw new ConfigurationException("analyzer " + analyzerid
+ " doesn't exist");
}
PerFieldAnalyzerWrapper tmpanalyzer = new PerFieldAnalyzerWrapper(
analyzer);
Configuration[] conffield = configuration.getChild(FIELDS_ELEMENT)
.getChildren(FIELD_ELEMENT);
for (int i = 0; i < conffield.length; i++) {
String fieldname = conffield[i].getAttribute(FIELD_NAME_ATTRIBUTE);
analyzerid = conffield[i].getAttribute(FIELD_ANALYZERID_ATTRIBUTE);
if (fieldname == null || fieldname.equals("")) {
throw new ConfigurationException("element " + FIELD_ELEMENT
+ " must have the " + FIELD_NAME_ATTRIBUTE
+ " attribute");
}
if (analyzerid == null || analyzerid.equals("")) {
throw new ConfigurationException("element " + FIELD_ELEMENT
+ " must have the " + FIELD_ANALYZERID_ATTRIBUTE
+ " attribute");
}
analyzer = analyzerM.getAnalyzer(analyzerid);
if (analyzer == null) {
throw new ConfigurationException("analyzer " + analyzerid
+ " doesn't exist");
}
tmpanalyzer.addAnalyzer(fieldname, analyzer);
}
this.analyzer = tmpanalyzer;
}