I've a scenario where I'm storing file contents and path in ES. The file mapping is simple -
File Details = >
Content hash (this is also an id of the document)
File path =>
I add the document first time if the same doesn't exists and update the File paths next time I come across a file with same content.
I'm using script ctx._source.paths += path where I'm passing path as a param. The insert is working fine as part of upsert and from # of deleted document I can see update is also happening. The only problem I've is I see only the last path seen for the file. Previous is getting replaced instead of a new entry getting added to the list.