All of our ElasticSearch documents contain a field called Categories which contains a string of comma-separated values. The length of each value between the commas is 5 characters, and the field can be anywhere from 1 to 12 5-character values.
I need to run a query against the index which says append ,ABCDE to the end of Categories field of all documents, unless the field already contains the value ABCDE in it, in which case do not append anything to the field.