private static void addField(SolrInputDocument doc, String fieldName, Object value, Class type, String dynamicFieldSuffix) {
    if (type.isArray())
      return; // TODO: Array types not supported yet ...
    if (dynamicFieldSuffix == null) {
      dynamicFieldSuffix = getDefaultDynamicFieldMapping(type);
      // treat strings with multiple terms as text only if using the default!
      if ("_s".equals(dynamicFieldSuffix)) {
        String str = (String)value;
        if (str.indexOf(" ") != -1)
          dynamicFieldSuffix = "_t";
      }
    }
    if (dynamicFieldSuffix != null) // don't auto-map if we don't have a type
      doc.addField(fieldName + dynamicFieldSuffix, value);
  }
private static void addField(SolrInputDocument doc, String fieldName, Object value, Class type, String dynamicFieldSuffix) {
    if (type.isArray())
      return;
    if (dynamicFieldSuffix == null) {
      dynamicFieldSuffix = getDefaultDynamicFieldMapping(type);
     
      if ("_s".equals(dynamicFieldSuffix)) {
        String str = (String)value;
        if (str.indexOf(" ") != -1)
          dynamicFieldSuffix = "_t";
      }
    }
    if (dynamicFieldSuffix != null)
      doc.addField(fieldName + dynamicFieldSuffix, value);
  }
private static void addfield(solrinputdocument doc, string fieldname, object value, class type, string dynamicfieldsuffix) { if (type.isarray()) return; if (dynamicfieldsuffix == null) { dynamicfieldsuffix = getdefaultdynamicfieldmapping(type); if ("_s".equals(dynamicfieldsuffix)) { string str = (string)value; if (str.indexof(" ") != -1) dynamicfieldsuffix = "_t"; } } if (dynamicfieldsuffix != null) doc.addfield(fieldname + dynamicfieldsuffix, value); }