solrj原子更新-如何将字段设置为空?
我对Solrj使用原子更新。它工作得很好,但我不知道如何删除现有文档中的字段 在Solr教程()中,他们解释了如何使用xml:solrj原子更新-如何将字段设置为空?,solr,solrj,Solr,Solrj,我对Solrj使用原子更新。它工作得很好,但我不知道如何删除现有文档中的字段 在Solr教程()中,他们解释了如何使用xml: <add> <doc> <field name="employeeId">05991</field> <field name="skills" update="set" null="true" /> </doc> </add> 05991 有人知道怎么从So
<add>
<doc>
<field name="employeeId">05991</field>
<field name="skills" update="set" null="true" />
</doc>
</add>
05991
有人知道怎么从SolrJ那里做吗
谢谢 好的。所以很明显,这就是这样做的方式-
SolrInputDocument inputDoc = new SolrInputDocument();
Map<String, String> partialUpdateNull = new HashMap<String, String>();
partialUpdateNull.put("set", null);
inputDoc.setField("FIELD_YOU_WANT_TO_DELETE", partialUpdateNull);
SolrInputDocument inputDoc=new SolrInputDocument();
Map partialUpdateNull=新HashMap();
partialUpdateNull.put(“set”,null);
inputDoc.setField(“要删除的字段”,partialUpdateNull);
无论如何谢谢你 检查一下,这可能会有帮助。