# Indexing keyword list in alphabetical order VS not sorting at all in elasticsearch

**URL:** <https://discuss.elastic.co/t/indexing-keyword-list-in-alphabetical-order-vs-not-sorting-at-all-in-elasticsearch/102380>\
**Category:** Elasticsearch\
**Created:** [October 1, 2017, 3:16pm UTC](https://discuss.elastic.co/t/indexing-keyword-list-in-alphabetical-order-vs-not-sorting-at-all-in-elasticsearch/102380 "2017-10-01T15:16:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fong\_Ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fong_ng/32/21533_2.png) [@Fong\_Ng](https://discuss.elastic.co/u/Fong_Ng)\
**Post date:** [October 1, 2017, 3:16pm UTC](https://discuss.elastic.co/t/indexing-keyword-list-in-alphabetical-order-vs-not-sorting-at-all-in-elasticsearch/102380/1 "2017-10-01T15:16:33Z")

</div>

I'm using elasticsearch to store lists of keywords with the `standard analyzer`, like this:

```
{
   id:1,
   body_color:'silver,blue',
   feature:'wifi,gps'  
},
{
   id:2,
   body_color:'blue,red',
   window_color:'yellow,white',
   feature:'multi core,wifi'
}

```

Does sorting these lists in alphabetical order, e.g)

```
{
   id:1,
   body_color:'blue,silver',
   feature:'gps,wifi'  
},
{
   id:2,
   body_color:'blue,red',
   window_color:'white,yellow',
   feature:'multi core,wifi'
}

```

require a smaller index size because of the more standard and less variations? Does it help for normalizing the tokens?

---

<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:** [October 1, 2017, 9:47pm UTC](https://discuss.elastic.co/t/indexing-keyword-list-in-alphabetical-order-vs-not-sorting-at-all-in-elasticsearch/102380/2 "2017-10-01T21:47:17Z")

</div>

It doesn't help because the underlying structures don't care about ordering. Sparsity is usually the bigger concern.

---

<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 29, 2017, 9:47pm UTC](https://discuss.elastic.co/t/indexing-keyword-list-in-alphabetical-order-vs-not-sorting-at-all-in-elasticsearch/102380/3 "2017-10-29T21:47:25Z")

</div>

Closed on October 29, 2017, 9:47pm UTC

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