Update a new field to existing document

Viewed 26906

is there possibility to update a new field to an existing document? For example: There is an document with several fields, e.g.

ID=99999
Field1:text
Field2:text

This document is already in the index, now I want to insert a new field to this document WITHOUT the old data:

ID=99999
Field3:text

For now, the old document will be deleted and a new document with the ID will be created. So if I now search for the ID 99999 the result will be:

ID=99999
Field3:text

I read this at the Solr Wiki

How can I update a specific field of an existing document?

I want update a specific field in a document, is that possible? I only need to index one field for >a specific document. Do I have to index all the document for this?

No, just the one document. Let's say you have a CMS and you edit one document. You will need to re-index this document only by using the the add solr statement for the whole document (not one field only).

In Lucene to update a document the operation is really a delete followed by an add. You will need >to add the complete document as there is no such "update only a field" semantics in Lucene.

So is there any solution for this? Will this function be implemented in a further version (I currently use 3.6.0). As a workaround, I thought about writing a script or an application, which will collect the existing fields, add the new field and update the whole document. But I think this will suffer performance. Do you have any other ideas?

Best regards

3 Answers
Related