How do I add a string array to an existing string array field in Elasticsearch with the help of script?

The result string array in Elasticsearch must be only contain unique string elements.

I know how to add a value in string array:

```
x = "test"
client.update index:'test', type:'test', id:'1', body:{script:"if (!ctx._source.a.contains(x)) {ctx._source.a += x;}", params:{x: x}}

```

I need the same code for string array

```
x = ["test1", "test2"]

```