Partial update with excluded fields

I'm trying to execute partial updates in an index with a excluded field. Below you can see the mapping of the index:

"mappings": {
    "doc": {
        "_source": {
        "excludes": [
	    "content"
        ]
    },
        "properties": {
	"id": {...},
            "name": {...}
            "folder": {...},
            "content": {
                ...,
                "index_options": "freqs"
             }
         }
    }
}

After a partial update of the field "folder", the field "content" is removed. I already understand that it's removed because is excluded.

For security reasons, I can't store the value of the field "content". So it's only indexed to be used in searches. The value of the field "content" is extracted from encrypted files from a java application and indexed in ES (it's a slow process).

The problem comes when a user changes the field "folder", then I have to repeat all the process of decryption of the files and indexation for all the documents with the same field "folder". This is a very inefficient process.

Do you know if it's possible to avoid this process and only update the folder field without losing the field "content"? I'm open to all solutions (join fields, encryptions). I use Elastic Seach 6.2.

Thanks in advance.

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