sunskin
sunskin

Reputation: 1680

How to update index of a document by its "id" in Solr?

How can I update or re-index solr index of an existing document in Solr by using its "id"? I am using Solr 4.0.

I researched but I don't find a definite answer anywhere.

Upvotes: 1

Views: 667

Answers (1)

Ganesh
Ganesh

Reputation: 603

Lucene is an append only store. Update syntax in solr would essentially translate into delete and insert. So we heed to give full document with all its fields to update. With Solr 4 and above, you have option of atomic update so that you can only update certain fields. In this case there is a constraint that all the solr schema fields should be "stored". So internally solr does get and then merge the field into the retrieved document and then insert.

The documentation links below:

Update using CSV - The index can also updated using XML

Atomic Update - This just saves on the network to retrieve the document to client and then update.

Upvotes: 2

Related Questions