# Sorting case insensitive

**URL:** <https://discuss.elastic.co/t/sorting-case-insensitive/289875>\
**Category:** Logstash\
**Created:** [November 22, 2021, 9:07pm UTC](https://discuss.elastic.co/t/sorting-case-insensitive/289875 "2021-11-22T21:07:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lyes\_Ouchene](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lyes_ouchene/32/77724_2.png) [@Lyes\_Ouchene](https://discuss.elastic.co/u/Lyes_Ouchene)\
**Post date:** [November 22, 2021, 9:07pm UTC](https://discuss.elastic.co/t/sorting-case-insensitive/289875/1 "2021-11-22T21:07:24Z")

</div>

Hello,

can i add a property to make sorting against a field case insensitive in logstash.

Thank you.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 22, 2021, 9:21pm UTC](https://discuss.elastic.co/t/sorting-case-insensitive/289875/2 "2021-11-22T21:21:33Z")

</div>

Are you saying you want to do something in logstash to make Elasticsearch sort order case insensitive, or are you actually doing sorting in logstash (if so, how)?

---

<div class="post-metadata">

**Author:** ![Lyes\_Ouchene](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lyes_ouchene/32/77724_2.png) [@Lyes\_Ouchene](https://discuss.elastic.co/u/Lyes_Ouchene)\
**Post date:** [November 22, 2021, 10:23pm UTC](https://discuss.elastic.co/t/sorting-case-insensitive/289875/3 "2021-11-22T22:23:00Z")

</div>

Hi Badger,

this is the first option, i want to do something in logstash to make case sorting insensitive in Elasticsearch.

thank you

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 22, 2021, 10:38pm UTC](https://discuss.elastic.co/t/sorting-case-insensitive/289875/4 "2021-11-22T22:38:01Z")

</div>

In logstash I think the only option would be to add another copy of each field and call mutate+lowercase on it, but that will double the size of your index.

It is better handled in Elasticsearch, with either a [custom\_analyzer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html) and a [lowercase](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-lowercase-tokenfilter.html) filter, or, more likely, a custom [normalizer](https://www.elastic.co/guide/en/elasticsearch/reference/current/normalizer.html). Questions about either of those approaches are better addressed in the Elasticsearch forum.

---

<div class="post-metadata">

**Author:** ![Lyes\_Ouchene](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lyes_ouchene/32/77724_2.png) [@Lyes\_Ouchene](https://discuss.elastic.co/u/Lyes_Ouchene)\
**Post date:** [November 22, 2021, 11:31pm UTC](https://discuss.elastic.co/t/sorting-case-insensitive/289875/5 "2021-11-22T23:31:00Z")

</div>

Thank you Badger

---

<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:** [December 20, 2021, 11:31pm UTC](https://discuss.elastic.co/t/sorting-case-insensitive/289875/6 "2021-12-20T23:31:45Z")

</div>

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