# Unable to create index sorting

**URL:** <https://discuss.elastic.co/t/unable-to-create-index-sorting/166019>\
**Category:** Elasticsearch\
**Created:** [January 28, 2019, 3:20pm UTC](https://discuss.elastic.co/t/unable-to-create-index-sorting/166019 "2019-01-28T15:20:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjireddy543](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anjireddy543](https://discuss.elastic.co/u/anjireddy543)\
**Post date:** [January 28, 2019, 3:20pm UTC](https://discuss.elastic.co/t/unable-to-create-index-sorting/166019/1 "2019-01-28T15:20:56Z")

</div>

Hi,

I want to create index sorting for my documents by default on date. In the mappings i have another field which is nested array.

In documentation i have read that we cannot create index sorting if index contains nested fields( **cannot have nested fields when index sort is activated** ).

Is their any alternate for this.

```
 "mappings" : {
      "judgements_v2" : {
        "_all" : {
          "enabled" : true
        },
        "properties" : {
 "date" : {
            "type" : "date",
            "format" : "dd-MM-yyyy"
          },
"categories" : {
            "type" : "nested",
            "include_in_parent" : true,
            "properties" : {
              "value" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 150,
                    "normalizer" : "my_normalizer"
                  }
                },
                "analyzer" : "autocomplete"
              }
            }
          },
}
}
}
```

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [February 1, 2019, 9:21am UTC](https://discuss.elastic.co/t/unable-to-create-index-sorting/166019/2 "2019-02-01T09:21:13Z")

</div>

Sorry, there is no alternative to it. `nested` documents create multiple Lucene documents under the hood which have to be colocated with their parent document. Using index sorting would break this structure.

---

<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:** [March 1, 2019, 9:21am UTC](https://discuss.elastic.co/t/unable-to-create-index-sorting/166019/3 "2019-03-01T09:21:26Z")

</div>

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