# How use complex params in java

**URL:** <https://discuss.elastic.co/t/how-use-complex-params-in-java/275446>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [June 9, 2021, 1:39pm UTC](https://discuss.elastic.co/t/how-use-complex-params-in-java/275446 "2021-06-09T13:39:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saberfate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saberfate/32/90058_2.png) [@saberfate](https://discuss.elastic.co/u/saberfate)\
**Post date:** [June 9, 2021, 1:39pm UTC](https://discuss.elastic.co/t/how-use-complex-params-in-java/275446/1 "2021-06-09T13:39:43Z")

</div>

Hi,

I'm using painless to do some complex json replacement. In REST call, I can use params like below

```auto
"params": {
    "doc": [{"b": "value3", "b1": "value33"}, {"d": "value44", "array1": ["abc", "123"]}],
    "total": 2
  }

```

but I can't find how to set the params Map it in java api with Script class?

```auto
Script inline =
          new Script(ScriptType.INLINE, "painless", scriptbody, paramsMap);

```

very appreciate if anyone can give a hand.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 7, 2021, 1:39pm UTC](https://discuss.elastic.co/t/how-use-complex-params-in-java/275446/2 "2021-07-07T13:39:59Z")

</div>

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