// treat strings with multiple terms as text only if using the default!
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);
  }
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;
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; // 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);
}