# Alphabetically sort name field

**URL:** <https://discuss.elastic.co/t/alphabetically-sort-name-field/276505>\
**Category:** Elasticsearch\
**Created:** [June 21, 2021, 8:33am UTC](https://discuss.elastic.co/t/alphabetically-sort-name-field/276505 "2021-06-21T08:33:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gautamz07](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@gautamz07](https://discuss.elastic.co/u/gautamz07)\
**Post date:** [June 21, 2021, 8:33am UTC](https://discuss.elastic.co/t/alphabetically-sort-name-field/276505/1 "2021-06-21T08:33:34Z")

</div>

I have the following definition for the name field

```auto
"name": {
  "type": "text",
  "fields": {
    "keyword": {
      "type": "keyword",
      "ignore_above": 256
    }
  }
},

```

How do i sort this alphabetically ?

I am trying the following

```auto
{
  "query": {
    "match": {
      "name": "Shoes"
    }
  },
  "sort": {
    "keyword": {
       "order": "asc"
    }  
  },
  "size": 10,
  "from": 0,
  "sort": []
}

```

But the sort somehow does't seem to be doing anything at all.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 22, 2021, 10:43pm UTC](https://discuss.elastic.co/t/alphabetically-sort-name-field/276505/2 "2021-06-22T22:43:21Z")

</div>

Welcome to our community! 😃

Shouldn't the sort be on `name.keyword`?

---

<div class="post-metadata">

**Author:** ![gautamz07](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@gautamz07](https://discuss.elastic.co/u/gautamz07)\
**Post date:** [June 28, 2021, 5:26pm UTC](https://discuss.elastic.co/t/alphabetically-sort-name-field/276505/3 "2021-06-28T17:26:13Z")

</div>

yes thanks 🙂

---

<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:** [July 26, 2021, 5:26pm UTC](https://discuss.elastic.co/t/alphabetically-sort-name-field/276505/4 "2021-07-26T17:26:44Z")

</div>

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