# Custom script sort type \[integer\] not supported

**URL:** <https://discuss.elastic.co/t/custom-script-sort-type-integer-not-supported/74232>\
**Category:** Elasticsearch\
**Created:** [February 7, 2017, 1:56pm UTC](https://discuss.elastic.co/t/custom-script-sort-type-integer-not-supported/74232 "2017-02-07T13:56:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rinat.io](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rinat.io/32/15306_2.png) [@rinat.io](https://discuss.elastic.co/u/rinat.io)\
**Post date:** [February 7, 2017, 1:56pm UTC](https://discuss.elastic.co/t/custom-script-sort-type-integer-not-supported/74232/1 "2017-02-07T13:56:52Z")

</div>

Hey guys,

I'm trying to make a [custom script sorting](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_script_based_sorting) and can't find what `type` values I may use. [This page](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_memory_considerations) says that `short`, `integer` and `float` types are supported, but it gives me an error:

```auto
      "reason" : {
        "type" : "search_parse_exception",
        "reason" : "custom script sort type [integer] not supported",
        "line" : 12,
        "col" : 7
      }

```

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [February 7, 2017, 3:09pm UTC](https://discuss.elastic.co/t/custom-script-sort-type-integer-not-supported/74232/2 "2017-02-07T15:09:21Z")

</div>

The default scripting language is `Painless` and it calls integers `int`s. Sorry for the confusion. That page you linked is about Elasticsearch's types in mappings. [Here](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-painless.html) are some pages about painless.

---

<div class="post-metadata">

**Author:** ![rinat.io](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rinat.io/32/15306_2.png) [@rinat.io](https://discuss.elastic.co/u/rinat.io)\
**Post date:** [February 8, 2017, 11:40am UTC](https://discuss.elastic.co/t/custom-script-sort-type-integer-not-supported/74232/3 "2017-02-08T11:40:50Z")

</div>

I use ES 2.3.3 where groovy is default I guess, so both `int` and `integer` ain't working. The `number` type from example is working.

---

<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:** [March 8, 2017, 11:40am UTC](https://discuss.elastic.co/t/custom-script-sort-type-integer-not-supported/74232/4 "2017-03-08T11:40:51Z")

</div>

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