예제 #1
0
 /**
  * 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;
 }
예제 #2
0
 /** Generates a simple &lt;add&gt;&lt;doc&gt;... 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()]));
 }