query.addFilterQuery(name + ":*");
}
QueryResponse rsp = solrServer.query(query);
long founds = rsp.getResults().getNumFound();
FieldTypeInfo fty = processSchema.getFieldTypeInfo(type);
if (fty != null) {
Class<?> objType = SolrUtils.decodeSolrFieldType(fty.getClassName());
if (objType != null) {
ExtendedFieldSchemaInfo extendedFieldSchemaInfo = new SolrUtils.ExtendedFieldSchemaInfo(
processSchema, processField, name);
SolrAttribute at = new SolrAttribute(name, objType);
if (extendedFieldSchemaInfo.getUniqueKey()) {
at.setPk(true);
at.setUse(true);
}
if (extendedFieldSchemaInfo.getMultivalued()
&& !Geometry.class.isAssignableFrom(at.getType())) {
at.setType(String.class);
}
at.setEmpty(founds == 0);
solrAttributes.add(at);
} else {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Skipping attribute " + fty.getName()
+ " as we don't know how to map its type to a java object "
+ fty.getClassName());
}
}
}
}
// Reorder fields: empty after