# Kibana's Top Hits aggregation "sort by" field broken

**URL:** https://discuss.elastic.co/t/kibanas-top-hits-aggregation-sort-by-field-broken/216971
**Category:** Kibana
**Created:** [January 29, 2020, 9:34am UTC](https://discuss.elastic.co/t/kibanas-top-hits-aggregation-sort-by-field-broken/216971 "2020-01-29T09:34:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mrotmann](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mrotmann](https://discuss.elastic.co/u/mrotmann)
#### Post date: [January 29, 2020, 9:34am UTC](https://discuss.elastic.co/t/kibanas-top-hits-aggregation-sort-by-field-broken/216971/1 "2020-01-29T09:34:10Z")

</div>

I am using Kibana to visualizing some data. The "terms aggregation" is kind of broken.  
It looks like this:

![Unbenannt](https://us1.discourse-cdn.com/elastic/original/3X/e/4/e43622c79a3e8d3fe83807d9a4febba737cd1ccf.png)

So there are to fields named "field", i guess one of whose should be "sortBy" (referring to screenshots across the web).  
Furthermore, i cannot select only number fields in this second "field", but i want to sort by date.

What is wrong here? My current workaround is to manually edit the url of the kibana request each time.

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [January 29, 2020, 2:46pm UTC](https://discuss.elastic.co/t/kibanas-top-hits-aggregation-sort-by-field-broken/216971/2 "2020-01-29T14:46:34Z")

</div>

We are tracking this issue here: [https://github.com/elastic/kibana/issues/54460](https://github.com/elastic/kibana/issues/54460)

---

<div class="post-metadata">

### Author: ![mrotmann](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mrotmann](https://discuss.elastic.co/u/mrotmann)
#### Post date: [January 30, 2020, 8:33pm UTC](https://discuss.elastic.co/t/kibanas-top-hits-aggregation-sort-by-field-broken/216971/3 "2020-01-30T20:33:47Z")

</div>

It seems like in that issue only the description of the input field is dicussed?  
I cannot select any other fields to sort by other than that selected in the first field...

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [January 30, 2020, 9:49pm UTC](https://discuss.elastic.co/t/kibanas-top-hits-aggregation-sort-by-field-broken/216971/4 "2020-01-30T21:49:19Z")

</div>

Yes, we are aware of the bug, and are tracking a fix in that issue

---

<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: [February 27, 2020, 9:49pm UTC](https://discuss.elastic.co/t/kibanas-top-hits-aggregation-sort-by-field-broken/216971/5 "2020-02-27T21:49:25Z")

</div>

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