Object o = value.get(f.pos());
if (o instanceof GenericArray) {
GenericArray ga = (GenericArray) o;
for (Object e : ga) {
if (e instanceof SpecificRecord) {
SpecificRecord sr = (SpecificRecord) e;
addField(sr, sr.getSchema(), document, field, solrfield);
} else {
throw new AvroBaseException("Invalid field name" + solrfield);
}
}
return;
}
} else {
throw new AvroBaseException("Invalid field name" + solrfield);
}
}
f = schema.getField(field);
if (f != null) {
Object o = value.get(f.pos());
if (o instanceof GenericArray) {
GenericArray ga = (GenericArray) o;
for (Object e : ga) {
if (e instanceof SpecificRecord) {
SpecificRecord sr = (SpecificRecord) e;
Schema.Field idField = sr.getSchema().getField("id");
if (idField != null) {
document.addField(solrfield, sr.get(idField.pos()));
}
} else {
document.addField(solrfield, e);
}
}