Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you delete a field from a document in Solr index?

Tags:

java

field

solr

I have a big index, and during the indexation process there was an error. So to avoid reindexing which takes several days, I want to simply delete specific field and reindex. Is there any suggestion?

like image 383
user3111525 Avatar asked Jan 26 '11 08:01

user3111525


1 Answers

If you're using Solr 4, you can use AtomicUpdate http://wiki.apache.org/solr/Atomic_Updates to remove a field much more easily. For example:

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}}]'
like image 92
Shao-Chuan Wang Avatar answered Oct 08 '22 11:10

Shao-Chuan Wang