# Kibana sorts big numbers wrong

**URL:** <https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326>\
**Category:** Kibana\
**Created:** [June 16, 2020, 3:03pm UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326 "2020-06-16T15:03:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbeyer](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@jbeyer](https://discuss.elastic.co/u/jbeyer)\
**Post date:** [June 16, 2020, 3:03pm UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326/1 "2020-06-16T15:03:44Z")

</div>

For a test, I inserted 1000 docs into elasticsearch index. One column has a consecutive number (3. column in the screen shot). This column is sorted ascending in Kibana. After the 253. row Kibana breaks the order and shows me a number that is less than the previous one and not at the beginning. I tested this issue in Kibana 7.7.0 and 7.7.1. The third column is a number in the index patterns. (Sorry in the screen shot you can't see the column header, thats the reason that I described it as 3. column).

 ![Kibana Issue Big Numbers](https://us1.discourse-cdn.com/elastic/original/3X/9/7/97eefa5c8ee5a7eeba350ff71820731f4130a1dd.png)

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [June 16, 2020, 4:58pm UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326/2 "2020-06-16T16:58:47Z")

</div>

@jbeyer - can you post a couple of example documents? It would also be helpful to get the index mapping - [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html)

---

<div class="post-metadata">

**Author:** ![jbeyer](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@jbeyer](https://discuss.elastic.co/u/jbeyer)\
**Post date:** [June 17, 2020, 7:47am UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326/3 "2020-06-17T07:47:35Z")

</div>

Hi mattkime, first hier is the index mapping:

```auto
  "testjb-2020.06.16-01" : {
    "mappings" : {
      "properties" : {
        "@timestamp" : {
          "type" : "date",
          "format" : "basic_date_time"
        },
        "app" : {
          "type" : "keyword"
        },
        "instance" : {
          "type" : "keyword"
        },
        "level" : {
          "type" : "keyword"
        },
        "message" : {
          "type" : "text"
        },
        "orderTicks" : {
          "type" : "keyword"
        },
        "orderTicksShort" : {
        "type" : "long"
        },
        "threadId" : {
          "type" : "keyword"
        }
      }
    }
  }
} ´´´

The column that I sorted is "orderTicksShort".
```

---

<div class="post-metadata">

**Author:** ![jbeyer](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@jbeyer](https://discuss.elastic.co/u/jbeyer)\
**Post date:** [June 17, 2020, 8:05am UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326/4 "2020-06-17T08:05:01Z")

</div>

And hier the sample documents (2 befor the sorting failure and 2 after):

> {  
> "\_index" : "testjb-2020.06.16-01",  
> "\_type" : "\_doc",  
> "\_id" : "SLZwvHIBfGd7M5axiLJB",  
> "\_version" : 1,  
> "\_seq\_no" : 999,  
> "\_primary\_term" : 1,  
> "found" : true,  
> "\_source" : {  
> "message" : "(Info) Lorem ipsum dolor sit 'amet', consetetur sadipscing elitr, ",  
> "@timestamp" : "20200616T112307.772+02:00",  
> "orderTicks" : "14466187772:0252",  
> "orderTicksShort" : "3703344069884",  
> "threadId" : "1",  
> "level" : "INFO",  
> "app" : "Application",  
> "instance" : "LogDemoAppHost"  
> }  
> }

> {  
> "\_index" : "testjb-2020.06.16-01",  
> "\_type" : "\_doc",  
> "\_id" : "SbZwvHIBfGd7M5axiLJB",  
> "\_version" : 1,  
> "\_seq\_no" : 1000,  
> "\_primary\_term" : 1,  
> "found" : true,  
> "\_source" : {  
> "message" : "(Info) Lorem ipsum dolor sit 'amet', consetetur sadipscing elitr, ",  
> "@timestamp" : "20200616T112307.772+02:00",  
> "orderTicks" : "14466187772:0253",  
> "orderTicksShort" : "3703344069885",  
> "threadId" : "1",  
> "level" : "INFO",  
> "app" : "Application",  
> "instance" : "LogDemoAppHost"  
> }  
> }

> {  
> "\_index" : "testjb-2020.06.16-01",  
> "\_type" : "\_doc",  
> "\_id" : "srZwvHIBfGd7M5axiK9B",  
> "\_version" : 1,  
> "\_seq\_no" : 337,  
> "\_primary\_term" : 1,  
> "found" : true,  
> "\_source" : {  
> "message" : "(Info) Lorem ipsum dolor sit 'amet', consetetur sadipscing elitr, ",  
> "@timestamp" : "20200616T112307.771+02:00",  
> "orderTicks" : "14466187771:0238",  
> "orderTicksShort" : "3703344069614",  
> "threadId" : "1",  
> "level" : "INFO",  
> "app" : "Application",  
> "instance" : "LogDemoAppHost"  
> }  
> }

> {  
> "\_index" : "testjb-2020.06.16-01",  
> "\_type" : "\_doc",  
> "\_id" : "s7ZwvHIBfGd7M5axiK9B",  
> "\_version" : 1,  
> "\_seq\_no" : 338,  
> "\_primary\_term" : 1,  
> "found" : true,  
> "\_source" : {  
> "message" : "(Info) Lorem ipsum dolor sit 'amet', consetetur sadipscing elitr, ",  
> "@timestamp" : "20200616T112307.771+02:00",  
> "orderTicks" : "14466187771:0239",  
> "orderTicksShort" : "3703344069615",  
> "threadId" : "1",  
> "level" : "INFO",  
> "app" : "Application",  
> "instance" : "LogDemoAppHost"  
> }  
> }

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [June 18, 2020, 3:22pm UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326/5 "2020-06-18T15:22:53Z")

</div>

Which view in kibana are you looking at?

---

<div class="post-metadata">

**Author:** ![jbeyer](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@jbeyer](https://discuss.elastic.co/u/jbeyer)\
**Post date:** [June 18, 2020, 3:49pm UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326/6 "2020-06-18T15:49:28Z")

</div>

Hi, it is the "Discover" - View or tab from the left side bar and I added the "Available fields", that I need to show.

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [June 21, 2020, 4:34am UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326/7 "2020-06-21T04:34:15Z")

</div>

Could you provide screenshots of the column headers? Do you have any search or filter criteria in the search bar?

It might also be helpful to take a look at the request and response being send to elasticsearch via the browser console.

---

<div class="post-metadata">

**Author:** ![jbeyer](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@jbeyer](https://discuss.elastic.co/u/jbeyer)\
**Post date:** [June 22, 2020, 8:07am UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326/8 "2020-06-22T08:07:24Z")

</div>

Hi, I found the reason of the issue: If I click the the sort triangle on the column "orderTicksShort" for sorting ascending than on column "Time" there is also the sort triangle set for sorting descending. Thats the default if I start Discovery. I was thinking, if I click the sorting on a column, than the sorting on the other column stops. But it isn't. If only sorting on the column "orderTicksShort" is active, than it sorts right.

 ![Kibana Issue Big Numbers2](https://us1.discourse-cdn.com/elastic/original/3X/2/3/23124170dadc0d8a63f35417be87e0677d46553e.png)

---

<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 20, 2020, 8:07am UTC](https://discuss.elastic.co/t/kibana-sorts-big-numbers-wrong/237326/9 "2020-07-20T08:07:24Z")

</div>

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