/** * Get all the values for a field. * * @param name name of the field to fetch * @return value of the field or null if not set */ public Collection<Object> getFieldValues(String name) { SolrInputField field = getField(name); if (field != null) { return field.getValues(); } return null; }
/** Generates a simple <add><doc>... XML String with no options */ public String adoc(SolrInputDocument sdoc) { List<String> fields = new ArrayList<String>(); for (SolrInputField sf : sdoc) { for (Object o : sf.getValues()) { fields.add(sf.getName()); fields.add(o.toString()); } } return adoc(fields.toArray(new String[fields.size()])); }