Restrict the fields from being updated

Hi ,

Is there a way to restrict the updation of a particular field while indexing a document.
For example I have a field 'name' which is of type text and I index a document , next time I try to change this 'name' either it should throw me an erro or should not accept the new value.

Change it how?
If you are talking about changing it from a text field to numeric, Elasticsearch will not allow that.

Hi @warkolm
If suppose I try to index a document the 2nd time and this time the name field is changed from "Tom" to "Bob" , I want to prevent this change , restrict a field from being updated.

Ok, you want to stop a document from being updated entirely?

@warkolm
Not entire document but few fields in the document

The only way to do that is via field level security.

As far as I know enabling field level security gives a read only view of the index so I do not think it is a solution. This is not possible in Elasticsearch so is something you would control in your code when indexing or updating the data.

Ah yes, you are right. It doesn't cover writes.

Thank you @Christian_Dahlqvist

Thank you @warkolm

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.