1

Does solr allow updating specific field rather than indexing entire document.

I know solr 1.4 doesn't.

Has this been implemented in newer versions?

Rahul
  • 1,403
  • 4
  • 18
  • 31
  • 1
    possible duplicate of [Update specific field on SOLR index](http://stackoverflow.com/questions/2032813/update-specific-field-on-solr-index) – Mauricio Scheffer Dec 03 '11 at 12:37

3 Answers3

26

Not the correct answer anymore. SOLR 4.0 supports the partial updates you are talking about. See http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/

  • 1
    that right, I did it like you said, but I have other questions, if my schema.xml file not defined the primary key, I want to update documents by conditions, I throw a exception, it can not update fields by conditions? – bright Sep 02 '13 at 09:19
3

Nope. Solr doesn't allow updating a specific field.
You would need to update the document again with all the existing values and the changed values.
The Update basically is delete and add of the document.

Update

Solr does Allow Partial Updates with 4.0 @ http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/

Jayendra
  • 52,349
  • 4
  • 80
  • 90
  • Now there is "Updating Parts of Documents" feature: https://lucene.apache.org/solr/guide/6_6/updating-parts-of-documents.html – Igor Kanshyn Aug 20 '18 at 16:06
1

Atomic updates are possible in solr. Please refer https://wiki.apache.org/solr/UpdateJSON#Solr_4.0_Example