我有一个大索引,并在索引过程中出现错误.因此,为了避免重新索引需要几天,我想简单地删除特定字段和重新索引.有什么建议吗?
如果您使用的是Solr 4,则可以使用AtomicUpdate http://wiki.apache.org/solr/Atomic_Updates 更轻松地删除字段.例如:
curl http://localhost:8983/solr/update?commit=true -H 'Content-type:application/json' --data-binary '[{"id": "630911fa-711a-3944-b1d2-cda6857f9827", "field_to_be_removed": {"set": null}}]'
Run Code Online (Sandbox Code Playgroud)
你可以这样做,如果你的其余字段存储,即stored="true ".as后面设置空值.
<add>
<doc>
<!-- your unique key field -->
<field name="employeeId">05991</field>
<!-- what ever field you want to delete -->
<field name="skills" update="set" null="true" />
</doc>
</add>
Run Code Online (Sandbox Code Playgroud)
来源:https://wiki.apache.org/solr/UpdateXmlMessages