Java Solr更新时的NumberFormatException

Java Solr更新时的NumberFormatException,java,solr,Java,Solr,当更新Solr索引上的浮动字段价格时,我得到了一个NumberFormatException。schema.xml中的价格定义: 字段名=价格类型=tfloat索引=真存储=真 必需=假多值=假 以下是我设置更新的方式: Float newVal = 69.9f; Map<String, Float> partialUpdatePrice = new HashMap<String, Float>(); partialUpdatePrice.put("set", newVa

当更新Solr索引上的浮动字段价格时,我得到了一个NumberFormatException。schema.xml中的价格定义:

字段名=价格类型=tfloat索引=真存储=真 必需=假多值=假

以下是我设置更新的方式:

Float newVal = 69.9f;
Map<String, Float> partialUpdatePrice = new HashMap<String, Float>();
partialUpdatePrice.put("set", newVal);
doc.addField("price", partialUpdatePrice);
将文档发送到Solr时,Solr日志中出现以下异常:

java.lang.NumberFormatException:对于输入字符串:{set=69.9}


谢谢

{set=69.9}不是一个数字。这是一个字符串。对,但是根据这个文档:部分更新应该这样做。如果您选中newVal,您将看到它是一个浮动;是缺少一个;这是您当前的代码吗?不,为了更好地理解,我简化了代码,犯了一个错误,对不起。现在更正。。。