# Sort order of "View surrounding documents" view

**URL:** https://discuss.elastic.co/t/sort-order-of-view-surrounding-documents-view/232280
**Category:** Kibana
**Created:** [May 12, 2020, 5:45pm UTC](https://discuss.elastic.co/t/sort-order-of-view-surrounding-documents-view/232280 "2020-05-12T17:45:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![thethomp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thethomp/32/39343_2.png) [@thethomp](https://discuss.elastic.co/u/thethomp)
#### Post date: [May 12, 2020, 5:45pm UTC](https://discuss.elastic.co/t/sort-order-of-view-surrounding-documents-view/232280/1 "2020-05-12T17:45:53Z")

</div>

Hello,

I have a use case where I would like the "View Surrounding Documents" view to present the data in timestamp ascending order, rather than descending. If I go change this bit in the URL I get the view I'd like, but was hoping there was a configuration or some way to make this the default behavior.

sort:!(timestamp,desc) --\> sort:!(timestamp,asc)

The main issue is the secondary sort that comes from the tie breaker config doesn't work properly unless my data is in ascending order. Being able to customize the tie breaker field secondary sort would also solve my problem, but those options seem even more limited.

The only work around I can think of is to go dig around in the source code and make this change myself.

Anyone have any other ideas, or have I overlooked anything obvious?

Thanks a bunch!

---

<div class="post-metadata">

### Author: ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)
#### Post date: [May 12, 2020, 9:10pm UTC](https://discuss.elastic.co/t/sort-order-of-view-surrounding-documents-view/232280/2 "2020-05-12T21:10:46Z")

</div>

hi, that sounds like a feature-request: I would log it: [https://github.com/elastic/kibana/issues/new/choose](https://github.com/elastic/kibana/issues/new/choose)

As for digging in the source-code, this is probably a good entry-point: [https://github.com/elastic/kibana/blob/15c0644c9756eb58e86cef7e7cd1ce8266bc7ed0/src/plugins/discover/public/application/angular/context/api/context.ts#L60](https://github.com/elastic/kibana/blob/15c0644c9756eb58e86cef7e7cd1ce8266bc7ed0/src/plugins/discover/public/application/angular/context/api/context.ts#L60)

---

<div class="post-metadata">

### Author: ![thethomp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thethomp/32/39343_2.png) [@thethomp](https://discuss.elastic.co/u/thethomp)
#### Post date: [May 19, 2020, 12:15am UTC](https://discuss.elastic.co/t/sort-order-of-view-surrounding-documents-view/232280/3 "2020-05-19T00:15:12Z")

</div>

Thanks for the reply - I went ahead and filed this feature request: [https://github.com/elastic/kibana/issues/66946](https://github.com/elastic/kibana/issues/66946)

I expanded it to allow the user to select the field and sort order of that view, as I think that covers far more use cases than the one I'm facing.

---

<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: [June 16, 2020, 12:15am UTC](https://discuss.elastic.co/t/sort-order-of-view-surrounding-documents-view/232280/4 "2020-06-16T00:15:13Z")

</div>

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