# Index Sorting Nested Fields

**URL:** <https://discuss.elastic.co/t/index-sorting-nested-fields/145965>\
**Category:** Elasticsearch\
**Created:** [August 24, 2018, 6:45pm UTC](https://discuss.elastic.co/t/index-sorting-nested-fields/145965 "2018-08-24T18:45:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![panda2004](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/panda2004/32/19473_2.png) [@panda2004](https://discuss.elastic.co/u/panda2004)\
**Post date:** [August 24, 2018, 6:45pm UTC](https://discuss.elastic.co/t/index-sorting-nested-fields/145965/1 "2018-08-24T18:45:52Z")

</div>

Hey all,  
I wanted to examine the option to use index sort. I did saw the following message [here](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/index-modules-index-sorting.html):  
`"An error will be thrown if index sorting is activated on an index that contains nested fields"`.

What does it mean? This error is just a warning or that feature isn't available at all for indices with nested fields?

This feature is really a must for me. Right now I index all my documents twice, for each date field I have: once by `action_time` field and once for `index_time` fields. This means I have 2 periodic indices instead of one.

---

<div class="post-metadata">

**Author:** ![jaddison](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jaddison](https://discuss.elastic.co/u/jaddison)\
**Post date:** [September 10, 2018, 3:39am UTC](https://discuss.elastic.co/t/index-sorting-nested-fields/145965/2 "2018-09-10T03:39:09Z")

</div>

From that [doc page you linked](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-index-sorting.html):

> nested fields are not compatible with index sorting because they rely on the assumption that nested documents are stored in contiguous doc ids, which can be broken by index sorting. An error will be thrown if index sorting is activated on an index that contains nested fields.

I think it's pretty clear: indexes with `nested` fields/docs are NOT compatible and won't be.

Perhaps if you explain why the feature "is a must" for your use case - better yet, what you're trying to do, volume of data, etc someone with _more know-how than me_ can chime in.

---

<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 8, 2018, 3:39am UTC](https://discuss.elastic.co/t/index-sorting-nested-fields/145965/3 "2018-10-08T03:39:09Z")

</div>

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