# Order by field in multiple indexes

**URL:** <https://discuss.elastic.co/t/order-by-field-in-multiple-indexes/200369>\
**Category:** Elasticsearch\
**Created:** [September 20, 2019, 7:53am UTC](https://discuss.elastic.co/t/order-by-field-in-multiple-indexes/200369 "2019-09-20T07:53:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akhil1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhil1/32/46158_2.png) [@Akhil1](https://discuss.elastic.co/u/Akhil1)\
**Post date:** [September 20, 2019, 7:53am UTC](https://discuss.elastic.co/t/order-by-field-in-multiple-indexes/200369/1 "2019-09-20T07:53:12Z")

</div>

I have a mapping for `direct conversations` and `group conversations` in elastic search DB. Every entry in each mapping has a field called `updatedTime`. I would like to get the conversations ordered based on the `updatedTime`. Is it possible to get this by keeping the conversations in two different indexes?

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [September 20, 2019, 7:59am UTC](https://discuss.elastic.co/t/order-by-field-in-multiple-indexes/200369/2 "2019-09-20T07:59:12Z")

</div>

Of course.

```
 POST /index1,index2/_search
  {
  "sort": {
    "updatedTime": {
      "order": "desc"
    }
  }
}
```

---

<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 18, 2019, 7:59am UTC](https://discuss.elastic.co/t/order-by-field-in-multiple-indexes/200369/3 "2019-10-18T07:59:16Z")

</div>

Closed on October 18, 2019, 7:59am UTC

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