# Is it possible to pass a large amount of parameters to painless script to perform sort?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-pass-a-large-amount-of-parameters-to-painless-script-to-perform-sort/312519>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [August 20, 2022, 12:23pm UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-a-large-amount-of-parameters-to-painless-script-to-perform-sort/312519 "2022-08-20T12:23:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_JW](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee_jw/32/109903_2.png) [@Lee\_JW](https://discuss.elastic.co/u/Lee_JW)\
**Post date:** [August 20, 2022, 12:23pm UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-a-large-amount-of-parameters-to-painless-script-to-perform-sort/312519/1 "2022-08-20T12:23:08Z")

</div>

Say there is a field that can be one of 200 distinct values (keyword). Every 2 different values are associated by a custom relevant score (it is a statistical data that cannot be mathematically calculted).

For example,

```auto
score("A", "B") = 1.45
score("A", "C") = 0.67
score("D", "F") = 2.29

```

Now I need to perform sorting on the field, according to the relevant score between every two distinct values (score("A", "B"), score("A", "C"), score("A", "D"), score("B", "C") ... ). How to acheive this? Can I pass 200 \* 200 = 40000 parameters to script to perform the sort?

---

<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:** [September 17, 2022, 12:23pm UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-a-large-amount-of-parameters-to-painless-script-to-perform-sort/312519/2 "2022-09-17T12:23:45Z")

</div>

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