# Apply a lowercase on indexed data

**URL:** <https://discuss.elastic.co/t/apply-a-lowercase-on-indexed-data/82748>\
**Category:** Elasticsearch\
**Created:** [April 18, 2017, 4:20pm UTC](https://discuss.elastic.co/t/apply-a-lowercase-on-indexed-data/82748 "2017-04-18T16:20:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Melvyn\_Peignon](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Melvyn\_Peignon](https://discuss.elastic.co/u/Melvyn_Peignon)\
**Post date:** [April 18, 2017, 4:20pm UTC](https://discuss.elastic.co/t/apply-a-lowercase-on-indexed-data/82748/1 "2017-04-18T16:20:00Z")

</div>

I have indexed documents in my elasticsearch. A sample document look like this:

```
{
    "_index": "processed_tweets",
    "_type": "processed",
    "_id": "830403820580663296",
    "_score": 1,
    "_source": {
      "at": [
        "@LouisDasch"
      ],
      "original_tweet_id": "830398288352403457",
      "id_str": "830403820580663296",
      "trigrams": [
        "blessed lourdes lady",
        "lourdes lady feast",
        "lady feast day",
        "feast day wishing"
      ],
      "hashtags": [
        "#Catholic"
      ],
      "id_tweet_creator": "487735029",
      "tokens": [
        "blessed",
        "lourdes",
        "lady",
        "feast",
        "day",
        "wishing"
      ],
      "bigrams": [
        "blessed lourdes",
        "lourdes lady",
        "lady feast",
        "feast day",
        "day wishing"
      ],
      "retweeted": true
    }
  }

```

I would like to lowercase all the hashtags present in the field "hashtags" for all the document I have indexed. For example I would have: "hashtags": ["#Catholic"] -\> "hashtags": ["#catholic"] What is the best way (lesss time consumming) to update every keywords to their lowercase equivalent (conserving the "#")?

---

<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:** [April 18, 2017, 10:16pm UTC](https://discuss.elastic.co/t/apply-a-lowercase-on-indexed-data/82748/2 "2017-04-18T22:16:37Z")

</div>

You will need to use the reindex API and build your own analyser to lowercase things.

---

<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:** [May 16, 2017, 10:25pm UTC](https://discuss.elastic.co/t/apply-a-lowercase-on-indexed-data/82748/3 "2017-05-16T22:25:38Z")

</div>

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