# Sort does not work properly with from size parameter on elastic 7.2

**URL:** <https://discuss.elastic.co/t/sort-does-not-work-properly-with-from-size-parameter-on-elastic-7-2/198084>\
**Category:** Elasticsearch\
**Created:** [September 4, 2019, 4:56pm UTC](https://discuss.elastic.co/t/sort-does-not-work-properly-with-from-size-parameter-on-elastic-7-2/198084 "2019-09-04T16:56:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enes\_Acikoglu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/enes_acikoglu/32/53590_2.png) [@Enes\_Acikoglu](https://discuss.elastic.co/u/Enes_Acikoglu)\
**Post date:** [September 4, 2019, 4:56pm UTC](https://discuss.elastic.co/t/sort-does-not-work-properly-with-from-size-parameter-on-elastic-7-2/198084/1 "2019-09-04T16:56:31Z")

</div>

```
Hello All,

```

We are using elastic 7.2 via rest high-level client on kotlin app. When we try to use below query sort return as false.It seems like sorting string instead of number like 1000-\>101-\>102 it looks third digit first 0 second 1 and last 2 than order like that.

```
GET attribute-lookup/_search
{
  "from": 10,
  "size": 5,
  "query": {
"bool": {
  "filter": [
    {
      "match_all": {
        "boost": 1
      }
    }
  ]
}
  },
  "_source": {
"includes": [
  "realId"
],
"excludes": []
  },
  "sort": [
{
  "realId": {
    "order": "asc"
  }
}
  ],
  "track_total_hits": 2147483647
}

```

**and result is**

```
{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 348,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [
      {
        "_index" : "lookup__20190904_0723",
        "_type" : "_doc",
        "_id" : "attribute/108",
        "_score" : null,
        "_source" : {
          "realId" : 108
        },
        "sort" : [
          "108"
        ]
      },
      {
        "_index" : "lookup__20190904_0723",
        "_type" : "_doc",
        "_id" : "attribute/109",
        "_score" : null,
        "_source" : {
          "realId" : 109
        },
        "sort" : [
          "109"
        ]
      },
      {
        "_index" : "lookup__20190904_0723",
        "_type" : "_doc",
        "_id" : "attribute/11",
        "_score" : null,
        "_source" : {
          "realId" : 11 // HERE WRONG ORDER
        },
        "sort" : [
          "11"
        ]
      },
      {
        "_index" : "lookup__20190904_0723",
        "_type" : "_doc",
        "_id" : "attribute/110",
        "_score" : null,
        "_source" : {
          "realId" : 110
        },
        "sort" : [
          "110"
        ]
      },
      {
        "_index" : "lookup__20190904_0723",
        "_type" : "_doc",
        "_id" : "attribute/111",
        "_score" : null,
        "_source" : {
          "realId" : 111
        },
        "sort" : [
          "111"
        ]
      }
    ]
  }
}
```

---

<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:** [October 2, 2019, 4:56pm UTC](https://discuss.elastic.co/t/sort-does-not-work-properly-with-from-size-parameter-on-elastic-7-2/198084/2 "2019-10-02T16:56:34Z")

</div>

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